查看文件: setmenu2.php
大小: 4.23 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php $_SERVER['PHP_SELF'] = "main.php?act=setmenu2";//$_SERVER['PHP_SELF']; 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['idx'].")".$row_R2['title']; $arr1[$i][3]=$_SERVER['PHP_SELF']."&mid=".$row_R2['mid'];//$row_R2['link']; $arr1[$i][4]="_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 flag='Y' AND cid = 0 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); $arr2=array(); $mycc=0; $c=0; $menutxt=''; $menutxt .= '<script language="JavaScript" type="text/javascript"> var myMenu = ['; do { $c++; $chkc=$c; $str1=$_SERVER['PHP_SELF']."&mid=".$row_R1['mid'];//$row_R1['link']<>''?"'".$row_R1['link']."'" :'null'; $str2="_self";//$row_R1['link_tag']<>''?"'".$row_R1['link_tag']."'" :'null'; //if ($c<>0){ $menutxt .= '], _cmSplit,'."\n"; } $str0=$row_R1['pic']<>''?'\'<img name="" src="'.$row_R1['pic'].'" width="36" height="20" alt="" />\'':'null'; $menutxt .= "[".$str0.", '(".$row_R1['idx'].")".$row_R1['title']."', '".$str1 ."','". $str2 ."', null "; $re2=($row_R1['mid']<>"")?sel($row_R1['mid']) :0; if ((count($re2)>0 )&&($re2[1][0]<>"")){ $menutxt .=","; for($i=1;$i<=count($re2);$i++){ if($re2[$i][0]<>""){ $c++; $str1=$re2[$i][3]<>''?"'".$re2[$i][3]."'" :'null'; $str2=$re2[$i][4]<>''?"'".$re2[$i][4]."'" :'null'; $menutxt .= "[null, '".$re2[$i][2]."', ". $str1 .",". $str2 .", null"; $re3=sel($re2[$i][0]); if ((count($re3)>0 )&&($re3[1][0]<>"")){ $menutxt .=","; for($j=1;$j<=count($re3);$j++){ if($re3[$j][0]<>""){ $str1=$re3[$j][3]<>''?"'".$re3[$j][3]."'" :'null'; $str2=$re3[$j][4]<>''?"'".$re3[$j][4]."'" :'null'; $menutxt .= "[null, '".$re3[$j][2]."',". $str1 .",". $str2 .", null "; $re4=sel($re3[$j][0]) ; if ((count($re4)>0 )&&($re4[1][0]<>"")){ $menutxt .=","; for($k=1;$k<=count($re4);$k++){ if($re4[$k][0]<>""){ $str1=$re4[$k][3]<>''?"'".$re4[$k][3]."'" :'null'; $str2=$re4[$k][4]<>''?"'".$re4[$k][4]."'" :'null'; $menutxt .= "[null, '".$re4[$k][2]."',". $str1 .",". $str2 .", null "; } $menutxt .="],\n"; } } $menutxt .="],\n"; } } } $menutxt .="],\n"; } } } $menutxt .= "], _cmSplit, \n"; } while ($row_R1 = mysql_fetch_assoc($R1)); $colname_Rt3 = "-1"; if (isset($_GET['mid'])) { $colname_Rt3 = $_GET['mid']; } mysql_select_db($database_BE2, $BE2); $query_Rt3 = sprintf("SELECT * FROM jscookmenu WHERE mid = %s", GetSQLValueString($colname_Rt3, "int")); $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); mysql_free_result($R1); ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title">網店管理頁面</h2> </div> <table width="100%" height="300" border="0" align="center"> <tr> <td width="25%" valign="top"><div ID=myMenuID></div></td> <td width="75%" align="left" valign="top"> <? $rt3title=$row_Rt3['title']; $rt3link = $row_Rt3['link']; $rt3mid = $row_Rt3['mid']; include "ad2_set.php" ;?> </td> </tr> </table> </div> </div> </div> <? //echo count($arr2)."<br>"; echo $menutxt .=" ] ;"; echo "cmDraw ('myMenuID', myMenu, 'vbr', cmThemeOffice, 'ThemeOffice');</script>"; ?> <? mysql_free_result($Rt3); ?>
保存
取消
返回文件列表