PageRenderTime 64ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/inc/top.inc.php

https://github.com/sangyuanyuan/fanqie
PHP | 290 lines | 260 code | 11 blank | 19 comment | 47 complexity | cced32a47473a83ba2e16613cbdecb3b MD5 | raw file
  1. <?
  2. require_once('../frame.php');
  3. $nav = new table_class("smg_nav");
  4. $nav = $nav->find("all",array('order' => 'id asc'));
  5. $db = get_db();
  6. use_jquery_ui();
  7. js_include_tag('jquery.cookie','pubfun');
  8. css_include_tag('top');
  9. function daysInSpan($start,$end)
  10. {
  11. $dayTicks=ticksInDay();
  12. return ($end-$start)/$dayTicks;
  13. }
  14. function ticksInDay()
  15. {
  16. $today=getdate();
  17. $yesterday=mktime(0,0,0,$today[mon],$today[mday]-1,$today[year]);
  18. $today=mktime(0,0,0,$today[mon],$today[mday],$today[year]);
  19. return $today-$yesterday;
  20. }
  21. $nowday=date('Y-m-d');
  22. ?>
  23. <div id=nav1>
  24. <div id=box>
  25. <a href="/dx/dx.php" target="_blank"><img src="/images/top/sms.jpg" border=0></a>
  26. <?php $xsb=$db->query('select id from smg_category where name="星尚榜"'); ?>
  27. <div id=context><a target="_blank" href="/news/news_list.php?id=<?php echo $xsb[0]->id;?>" target="_blank" style="color:#ff0000;font-weight:bold">星尚榜</a> <a href="/zone/" target="_blank" style="color:#ff0000;font-weight:bold">番茄个性版</a> <a id=line3 style="font-weight:bold; color:#0B0B8D;" href="http://172.27.203.81:8080/news/news/news.php?id=25939" target="_blank" >电脑防毒软件升级</a> <a href="http://172.27.203.88/emailfront/emailfront.htm" target="_blank">企业邮箱</a> <a href="#">新节目</a> <a href="#">直播</a> <a href="/contact/contact.php" target="_blank">联系我们</a> <span onclick="javascript:document.getElementById('toolcontent').style.display='inline'">常用办公软件</span></div>
  28. <a id=home href="/home/" target="_blank"><img src="/images/top/jiayuan.gif" border=0></a>
  29. </div>
  30. </div>
  31. <!--<div id=bannerimg>
  32. <div id=nimg1>
  33. <div class=deptlogo name=1></div>
  34. <div class=deptlogo name=2></div>
  35. <div class=deptlogo name=3></div>
  36. <div class=deptlogo name=7></div>
  37. <div class=deptlogo name=8></div>
  38. <div class=deptlogo name=9></div>
  39. <div class=deptlogo name=13></div>
  40. <div class=deptlogo name=14></div>
  41. <div class=deptlogo name=15></div>
  42. </div>
  43. <div id=nimg2>
  44. <div class=deptlogo name=4></div>
  45. <div class=deptlogo name=5></div>
  46. <div class=deptlogo name=6></div>
  47. <div class=deptlogo name=10></div>
  48. <div class=deptlogo name=11></div>
  49. <div class=deptlogo name=12></div>
  50. </div>
  51. <div id=fd>
  52. <div id=fd_l>
  53. <a target="_blank" href="/subject/jwzxsbh/">技术保障信息平台</a> <a target="_blank" href="http://192.168.61.247/">节目资源信息发布平台</a> <a target="_blank" href="/subject/fk/">世博安全保障平台</a>
  54. </div>
  55. <?php $banner=$db->query('select * from smg_news where category_id=208 and is_adopt=1 order by priority asc,created_at desc limit 2'); ?>
  56. <div id=fd_r>
  57. <a target="_blank" href="/news/news/news.php?id=<?php echo $banner[0]->id; ?>"><?php echo $banner[0]->title; ?></a> <a target="_blank" href="/news/news/news.php?id=<?php echo $banner[1]->id; ?>"><?php echo $banner[1]->title; ?></a>
  58. </div>
  59. </div>
  60. </div>-->
  61. <div id=bannerimg1>
  62. <!--<iframe src=/CR/index.html width="995" height="200" scrolling="no" frameborder="0"></iframe>-->
  63. <a target="_blank" href="http://172.27.203.81:8080/news/news/news.php?id=58728"><img border=0 src="/images/guoqing.gif"></a>
  64. </div>
  65. <div id=nav2>
  66. <div id=box <? if($nowday=="2010-04-01"){ ?>style="background:url('/images/top/bg2.jpg') no-repeat;"<?php } ?>>
  67. <div id=logo <?php if(date('Y-m-d')=="2010-04-01"){ ?>style="background:url('/images/top/logo2.jpg') no-repeat;"<?php } ?>></div>
  68. <?php for($j=0;$j<5;$j++){?>
  69. <ul>
  70. <?php for($i=8*$j;$i<8*($j+1);$i++) { ?>
  71. <li><?php if($i%4==0){?><b><?php }?><a href="<?php echo $nav[$i]->href;?>"><?php echo $nav[$i]->name;?></a><?php if($i%4==0){?></b><?php }?></li>
  72. <?php }?>
  73. </ul>
  74. <?php }?>
  75. <div id=weather>
  76. <iframe src="/index_weather<?php if($nowday=="2010-04-01"){ ?>1<?php } ?>.html" width=135px height=22px scrolling="no" frameborder="0"></iframe>
  77. </div>
  78. <span id=deptbtn <?php if($nowday=="2010-04-01"){ ?>style="background:url('/images/top/dept1.jpg') no-repeat;"<?php } ?> onclick='$("#deptcontent").show();'></span>
  79. <div id=search>
  80. <form id="top_search_form" method="get" action="/search/">
  81. <input type="text" name="key"></input>
  82. <button id=button1 <?php if($nowday=='2010-04-01'){ ?>style="background:url('/images/top/btn1_1.jpg') no-repeat;"<?php } ?>></button>
  83. <button id=button2 <?php if($nowday=='2010-04-01'){ ?>style="background:url('/images/top/btn2_1.jpg') no-repeat;"<?php } ?>></button>
  84. <input type="hidden" name="search_type" id="search_type_hidden" value="smg_news" style="display:none">
  85. </form>
  86. <?php
  87. $sql = 'select search_key,count(search_key) as icount from smg_search_keys where TO_DAYS(NOW())-TO_DAYS(created_at) <= 30 group by search_key order by icount desc limit 6';
  88. $record=$db -> query($sql);
  89. ?>
  90. <div id=hot>
  91. <?php //for($i=0;$i<1;$i++){?>
  92. <?php if(date('Y-m-d')!="2010-04-21"){ ?><!--<a href="http://qjdls.smgbb.cn" target=_blank><img style="width:50px; height:20px; margin-top:0px;" width=50 height=20 border=0 src="/images/qj.gif"></a>--><?php } ?>
  93. <!--<a href="/search/?key=<?php echo urlencode($record[0]->search_key)?>&search_type=smg_news" target=_blank><?php echo $record[0]->search_key ?></a>--> 
  94. <? //}?>
  95. <a href='/zongcai/' target="_blank">总裁奖</a><a style="margin-left:5px;" href='/subject/tw/' target="_blank">世博志愿者</a>
  96. </div>
  97. <div id=zongcai><?php if(date('Y-m-d')!="2010-04-21"){ ?><a target="_blank" href="http://192.168.61.247/" style="font-size:12px; text-decoration:none; color:#ffffff;">世博资源发布<!--<img border=0 style="width:86px; height:14px; margin-top:0px; background:none;" src="/images/pic/world.jpg">--></a><?php } ?></div>
  98. </div>
  99. <?php
  100. $cookie=isset($_COOKIE['smg_username']) ? $_COOKIE['smg_username'] : "";
  101. if($cookie!="")
  102. {
  103. $sql="SELECT count(*) as num FROM smg_birthday_gift where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(created_at) and reciever='".$cookie."'";
  104. $birthday1=$db->query($sql);
  105. $endtime=date("m-d",mktime(date("H",time()),date("i",time()),date("s",time()),date("m",time()),date("d",time())+7,date("Y",time())));
  106. $sql="select count(*) as num from smg_friends f left join smg_user_real a on f.friend_name=a.loginname where Date_format(a.birthday,'%m-%d')>='".date('m-d')."' and Date_format(a.birthday,'%m-%d')<='".$endtime."' and f.my_name='".$cookie."'";
  107. $birthday2=$db->query($sql);
  108. }
  109. ?>
  110. <input type="hidden" id="birthday1" style="display:none" value="<?php echo $birthday1[0]->num; ?>"><input type="hidden" style="display:none" id="birthday2" value="<?php echo $birthday2[0]->num; ?>">
  111. <div id=login>
  112. </div>
  113. </div>
  114. </div>
  115. &nbsp;
  116. <div id=tool>
  117. <div id=toolbox>
  118. <div id=toolcontent>
  119. <div class=tools><a href="http://172.28.2.112:2000/" target="_blank">新华社</a></div>
  120. <div class=tools><a href="http://172.27.203.88/techmanage/admin/chart_new1.asp" target="_blank">制作录象计划表</a></div>
  121. <div class=tools><a href="http://172.27.203.125" target="_blank">办公自动化系统</a></div>
  122. <div class=tools><a href="http://172.27.203.88/waishi/" target="_blank">外事管理系统</a></div>
  123. <div class=tools><a href="http://172.27.203.88/CBNBMS/login.aspx" target="_blank">SMG系统</a></div>
  124. <div class=tools><a href="http://172.27.203.41/test/login.php" target="_blank">奖金发放系统</a></div>
  125. <div class=tools><a href="http://172.27.203.88/chuanliandan/pro_select.htm" target="_blank">串联单查询</a></div>
  126. <div class=tools><a href="http://172.27.203.88/stvmis/login.asp" target="_blank">新闻来源系统</a></div>
  127. <div class=tools><a href="http://172.27.203.47/login/smglogin.jsp" target="_blank">管理信息平台</a></div>
  128. <div class=tools><a href="http://172.27.203.16:8088/zb/" target="_blank">节目信息管理系统</a></div>
  129. <div class=tools><a href="http://172.28.10.31/" target="_blank">广播节目检索系统</a></div>
  130. <div class=tools><a href="http://172.27.203.88/assetsmanage/ReadNews.asp?NewsID=1206&BigClassName=动态公告&SmallClassName=动态公告&SpecialID=0" target="_blank">集团固定资产管理信息系统</a></div>
  131. <div class=tools style="text-align:right; color:#FF0000; font-weight:bold; cursor:pointer; " onclick='$("#toolcontent").hide();'>关闭</div>
  132. </div>
  133. </div>
  134. </div>
  135. <div id=dept>
  136. <div id=deptbox>
  137. <div id=deptcontent>
  138. <?php
  139. $sql = 'select * from smg_dept_list order by priority asc';
  140. $record=$db -> query($sql);
  141. for($i=0;$i<count($record);$i++){
  142. ?>
  143. <div class=depts><a href="<?php echo $record[$i]->href;?>" target="_blank"><?php echo $record[$i]->name?></a></div>
  144. <? }?>
  145. <!--<div id=top>
  146. <div class=title>上海广播电视台</div>
  147. <?php
  148. $sql = 'select * from smg_dept_list s order by priority asc';
  149. $record=$db -> query($sql);
  150. for($i=0;$i<count($record);$i++){
  151. ?>
  152. <div class=depts><a href="<?php echo $record[$i]->href;?>" target="_blank"><?php echo $record[$i]->name?></a></div>
  153. <? }?>
  154. </div>
  155. <div id=bottom>
  156. <div class=title>上海东方传媒集团有限公司</div>
  157. <?php
  158. $sql = 'select * from smg_dept_list s where property=2 order by priority asc';
  159. $record=$db -> query($sql);
  160. for($i=0;$i<count($record);$i++){
  161. ?>
  162. <div class=depts><a href="<?php echo $record[$i]->href;?>" target="_blank"><?php echo $record[$i]->name?></a></div>
  163. <? }?>
  164. <div class=depts style="text-align:right; color:#FF0000; font-weight:bold; cursor:pointer; " onclick='$("#deptcontent").hide();'>关闭</div>
  165. </div>-->
  166. <div class=depts style="text-align:right; color:#FF0000; font-weight:bold; cursor:pointer; " onclick='$("#deptcontent").hide();'>关闭</div>
  167. </div>
  168. </div>
  169. </div>
  170. <script>
  171. $(function(){
  172. display_login();
  173. $('#button1').click(function(){
  174. $('#top_search_form').attr('action','/search/?search_key=smg_news');
  175. $('#search_type_hidden').val('smg_news');
  176. $('#top_search_form').submit();
  177. });
  178. $('#button2').click(function(){
  179. $('#top_search_form').attr('action','/search/');
  180. $('#search_type_hidden').val('');
  181. $('#top_search_form').submit();
  182. });
  183. $(".deptlogo").click(function(){
  184. var num=$(this).attr('name');
  185. if(num==1)
  186. {
  187. location.href="http://172.27.203.81:8080/blog/?uid-3398";
  188. }
  189. else if(num==2)
  190. {
  191. location.href="http://172.27.203.81:8080/newscenter/newscenter_blog.php";
  192. }
  193. else if(num==3)
  194. {
  195. location.href="http://172.27.203.81:8080/blog/index.php?uid-3367";
  196. }
  197. else if(num==4)
  198. {
  199. location.href="http://172.27.203.81:8080/blog/?uid-3370";
  200. }
  201. else if(num==5)
  202. {
  203. location.href="http://172.27.203.81:8080/blog/?uid-3394";
  204. }
  205. else if(num==6)
  206. {
  207. location.href="http://172.27.203.81:8080/blog/?3401";
  208. }
  209. else if(num==7)
  210. {
  211. location.href="http://172.27.203.81:8080/blog/?3385";
  212. }
  213. else if(num==8)
  214. {
  215. location.href="http://172.27.203.81:8080/home/space.php?uid=3408&do=blog&view=me";
  216. }
  217. else if(num==9)
  218. {
  219. location.href="http://172.27.203.81:8080/blog/?3392";
  220. }
  221. else if(num==10)
  222. {
  223. location.href="http://172.27.203.81:8080/blog/?uid-3386";
  224. }
  225. else if(num==11)
  226. {
  227. location.href="http://172.27.203.81:8080/blog/?3399";
  228. }
  229. else if(num==12)
  230. {
  231. location.href="http://172.27.203.81:8080/blog/?3402";
  232. }
  233. else if(num==13)
  234. {
  235. location.href="http://172.27.203.81:8080/blog/?3405";
  236. }
  237. else if(num==14)
  238. {
  239. location.href="http://172.27.203.81:8080/blog/?uid-3406";
  240. }
  241. else if(num==15)
  242. {
  243. location.href="http://172.27.203.81:8080/blog/?3444";
  244. }
  245. });
  246. /*var d=new Date();
  247. var starttime=d.getYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
  248. var day=getDateDiff(starttime,'2010-07-08');
  249. if(day>0&&day<7)
  250. {
  251. $("#day").attr('src','/images/dmz/logo'+day+'.jpg');
  252. }
  253. else if(day==0)
  254. {
  255. $("#day").attr('src','/images/dmz/logo_start.jpg');
  256. }
  257. else if(day<-4)
  258. {
  259. $("#day").attr('src','/images/dmz/logo_end.jpg');
  260. }
  261. else
  262. {
  263. $("#day").attr('src','/images/dmz/logo_ing.jpg');
  264. }*/
  265. });
  266. function getDateDiff(date1,date2){
  267. var re = /^(\d{4})\S(\d{1,2})\S(\d{1,2})$/;
  268. var dt1,dt2;
  269. if (re.test(date1))
  270. {
  271. dt1 = new Date(RegExp.$1,RegExp.$2 - 1,RegExp.$3);
  272. }
  273. if (re.test(date2))
  274. {
  275. dt2 = new Date(RegExp.$1,RegExp.$2 - 1,RegExp.$3);
  276. }
  277. return Math.floor((dt2-dt1)/(1000 * 60 * 60 * 24));
  278. }
  279. </script>