查看文件: header_menu.php
大小: 7.06 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php function sel($cid){ require('../Connections/BE2.php'); mysql_select_db($database_BE2, $BE2); $query_R2 = "SELECT * FROM jscookmenu WHERE flag='Y' AND cid = '$cid' ORDER BY idx ASC"; $R2 = mysql_query($query_R2, $BE2) or die(mysql_error()); $row_R2 = mysql_fetch_assoc($R2); $totalRows_R2 = mysql_num_rows($R2); $arr1=array(); $i=1; do { $arr1[$i][0]=$row_R2['mid']; $arr1[$i][1]=$row_R2['cid']; $arr1[$i][2]=$row_R2['title']; $arr1[$i][3]=strpos($row_R2['link'],"//")?$row_R2['link']:"/".$row_R2['link']; //$_SERVER["PHP_SELF"]."?id=".$row_R2['mid']; //$row_R2['link']; $arr1[$i][4]=$row_R2['doc'];//"_self";//$row_R2['link_tag']; $arr1[$i][5]=$row_R2['pic'];//"_self";//$row_R2['link_tag']; $arr1[$i][6]=$row_R2['link_tag'];//"_self";//$row_R2['link_tag']; $i++; } while ($row_R2 = mysql_fetch_assoc($R2)); if (count($arr1)<1 ){return 0; }else{return $arr1;} } mysql_select_db($database_BE2, $BE2); $query_R1 = "SELECT * FROM jscookmenu WHERE mid>1 AND cid = 0 AND flag='Y' ORDER BY idx ASC"; $R1 = mysql_query($query_R1, $BE2) or die(mysql_error()); $row_R1 = mysql_fetch_assoc($R1); $totalRows_R1 = mysql_num_rows($R1); // logo data $menu1=isset($_GET['menu'])?$_GET['menu']:'index'; // $dirname = dirname(__FILE__); $REQUEST_URI=$_SERVER['REQUEST_URI']; $pos = strpos($REQUEST_URI, '/',1); if($pos>0){ $REQUEST_URI=substr($REQUEST_URI,0,$pos+1); }else{ $REQUEST_URI='/' ;} mysql_select_db($database_BE2, $BE2); $query_Lo1 = sprintf("SELECT * FROM logo_img WHERE lurlbase='%s' AND lurl='%s' ",$REQUEST_URI,$menu1); $Lo1 = mysql_query($query_Lo1, $BE2) or die(mysql_error()); $row_Lo1 = mysql_fetch_assoc($Lo1); $totalRows_Lo1 = mysql_num_rows($Lo1); $logo_image=array('skybni_logo.png','b1.png','skybni.png'); $logo_title=array('天空商城','天空商城','skybni'); if($totalRows_Lo1>0){ $imgpath= '/www2/skybni/logo_img/'.$row_Lo1['lcode']; if( file_exists($imgpath.'_1.png')){$logo_image[0]= $row_Lo1['lcode'].'_1.png';} if( file_exists($imgpath.'_2.png')){$logo_image[1]= $row_Lo1['lcode'].'_2.png';} if( file_exists($imgpath.'_3.png')){$logo_image[2]= $row_Lo1['lcode'].'_3.png';} $logo_title[0]=$row_Lo1['doc1']; $logo_title[1]=$row_Lo1['doc2']; $logo_title[2]=$row_Lo1['doc3']; } mysql_free_result($Lo1); // logo img $rlogo= ilogo_img(); ?> <!-- Header --> <header id="js-header" class="u-header u-header--static u-header--show-hide u-header--change-appearance u-header--has-hidden-element" data-header-fix-moment="200" data-header-fix-effect="slide"> <div class="u-header__section u-header__section--light g-bg-white g-transition-0_3 g-py-15" data-header-fix-moment-exclude="g-bg-white g-py-15"> <!--<header id="js-header" class="u-header u-header--static"> <div class="u-header__section u-header__section--light g-bg-white g-transition-0_3 g-py-15">--> <nav class="js-mega-menu navbar navbar-expand-md hs-menu-initialized hs-menu-horizontal"> <div class="container"> <!-- Responsive Toggle Button --> <button class="navbar-toggler navbar-toggler-right btn g-line-height-1 g-brd-none g-pa-0 g-pos-abs g-top-3 g-right-0" type="button" aria-label="Toggle navigation" aria-expanded="false" aria-controls="navBar" data-toggle="collapse" data-target="#navBar"> <span class="hamburger hamburger--slider"> <span class="hamburger-box"> <span class="hamburger-inner"></span> </span> </span> </button> <!-- End Responsive Toggle Button --> <!-- Logo --> <div style="display:flex;align-items:center;"> <a href="/"><img src="/logo_img/<?= $rlogo[0][0] ; ?>" title="<?= $rlogo[1][0] ; ?>"></a> <div> <a href="/"><img src="/logo_img/<?= $rlogo[0][1] ; ?>" title="<?= $rlogo[1][1] ; ?>"></a> <br><a href="/"><img src="/logo_img/<?= $rlogo[0][2] ; ?>" title="<?= $rlogo[1][2] ; ?>"></a> </div> </div> <!-- End Logo --> <!-- Navigation --> <div class="collapse navbar-collapse align-items-center flex-sm-row g-pt-10 g-pt-5--lg g-mr-20--lg" id="navBar"> <ul class="navbar-nav g-pos-rel g-font-weight-600 ml-auto g-font-size-13"> <? $c=1; do { $ilink1=($row_R1['link']=="")?"#":$row_R1['link']; $ilink1=(strpos($ilink1,"//"))?$ilink1:"/".$ilink1; ?> <? $re2=($row_R1['mid']<>"")?sel($row_R1['mid']) :0; $sub=false; if ((count($re2)>0 )&&($re2[1][0]<>"")){ $sub=true; $ilink1="#s".$c;} ?> <li class="nav-item hs-has-sub-menu g-mx-10--lg g-mx-10--xl" data-animation-in="fadeIn" data-animation-out="fadeOut"> <a id="nav-link--features" class="nav-link g-py-7 g-px-0 g-color-indigo" href="<?= $ilink1;?>" aria-haspopup="true" aria-expanded="false" aria-controls="nav-submenu--features"><? echo $row_R1['title'] ?></a> <? if ($sub==true){ ?> <ul class="hs-sub-menu list-unstyled u-shadow-v11 g-brd-top g-brd-primary g-brd-top-2 g-min-width-220 g-mt-18 g-mt-8--lg--scrolling" aria-labelledby="nav-link--features"> <? for($i=1;$i<=count($re2);$i++){ ?> <li class="dropdown-item"> <a class="nav-link" href="<?= $re2[$i][3] ?>"><?= $re2[$i][2] ?></a> </li> <? } ?> </ul> <? } // end $sub ?> </li> <? $c++; } while ($row_R1 = mysql_fetch_assoc($R1)); ?> <li class="list-inline-item mt-1 g-mx-10--lg g-mx-10--xl"> <a href="/<?= $_SESSION['login_memid']==''?'registerform.html':'guest/'; ?>" class="u-tags-v1 g-color-white g-bg-primary g-rounded-10 g-py-4 g-px-10"><?= $_SESSION['login_memid']==''?'註冊會員':'個資管理'; ?></a> </li> <li class="list-inline-item mt-1"> <a href="/<?= $_SESSION['login_memid']==''?'login':'logout'; ?>.html" class="u-tags-v1 g-color-white g-bg-red g-rounded-10 g-py-4 g-px-10">會員登<?= $_SESSION['login_memid']==''?'入':'出'; ?></a> </li> </ul> </div> <!-- End Navigation --> <!-- Search --> <? /* <div> <a href="#!" class="g-font-size-14 g-color-main g-ml-50" aria-haspopup="true" aria-expanded="false" aria-controls="searchform-1" data-dropdown-target="#searchform-1" data-dropdown-type="css-animation" data-dropdown-duration="300" data-dropdown-animation-in="fadeInUp" data-dropdown-animation-out="fadeOutDown"> <i class="fa fa-search"></i> </a> </div> */ ?> <!-- End Search --> </div> </nav> </div> </header> <!-- End Header -->
保存
取消
返回文件列表