羽恒梦工厂主页项目
这是前台页面
下面是主页的代码
<?php include("../DBDA.class.php"); $db=new DBDA(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <link href="login.css" rel="stylesheet" type="text/css" /> <script src="../jquery-1.11.2.min.js"></script> <style> #dlxx{ margin:0 0 0 auto; text-align:right; height:10px; position:relative; top:10px} #yonghuming{ width: auto; max-width:160px; text-align:center;} #zhuxiao{ width:46px; text-align:center;} #huiyuanzhx{ width:76px; text-align:center} #dl{ width:46px; text-align:center;} #zc{ width:46px; text-align:center;} .yh{ float:left;} .yh:hover{ cursor:pointer} #top{ background-image:url(img/header.png); background-repeat:no-repeat; background-position:center; height:158px; width:100%; min-width:1347px; max-width:1920px;} #dhl_wai{margin:0 auto; text-align:center; width:1190px; height:35px} #logo{ margin:0 auto; text-align:center;width:290px; height:80px; position:relative; top:35px } #logo:hover{ cursor:pointer} .dhl{ float:left; font-size:26px; width:80px; margin:0 33px; position:relative; top:-10px} .dhl:hover{ cursor:pointer; color:#faa66a} .right{ margin-left:343px} #second{background-image:url(img/banner.png); background-repeat:no-repeat; background-position:center; height:308px; width:100%; min-width:1347px; max-width:1920px} </style> </head> <body> <!--导航--> <div id="top"> <div id="dlxx"> </div> <div id="logo"><img src="img/logo.png" /></div> <div id="dhl_wai"> <?php $dhlb = "select * from leibie"; $dh = $db->Query($dhlb); foreach($dh as $k=>$v){ $class = $k==3?"dhl right":"dhl" ; echo "<div class='{$class}' code='{$v[0]}'>{$v[2]}</div>"; } ?> </div> </div> <div style="clear:both"></div> <!--中间图--> <div id="second"></div> <div style="clear:both"></div> <!--主页界面--> <div id="zhuye"> <div id="zhuye_da"> <?php $sql="select code,main_pic from main where video_leibie=6"; $attr =$db->Query($sql); foreach($attr as $v) { echo "<div class='zhuye_x'>"; echo "<a href='xiangqing.php?code={$v[0]}'><img class='zhuye_t' src='{$v[1]}' /></a>"; echo "</div>"; } ?> </div> </div> <!--最下面--> <script> $(document).ready(function(e) { dengluxx(); $.ajax({ url:"dhchuli.php", dataType:"TEXT", success: function(data){ var hang=data.split("|"); var str=""; for(var i=0;i<5;i++){ if(i==3){ var lie=hang[i].split("^"); str+="<a href='buju.php?code="+lie[1]+"'><div class='daohang_1'>"+lie[2]+"</div></a>"; }else{ var lie=hang[i].split("^"); str+="<a href='buju.php?code="+lie[1]+"'><div class='daohang_2' code='"+lie[1]+"'>"+lie[2]+"</div></a>"; } } $("#dh_jieshou").html(str); } }); }); function dengluxx(){ $.ajax({ url:"./chuli/htshjchuli.php", async:false, data:{tp:4}, type:"POST", dataType:"TEXT", success: function(data){ $("#dlxx").html(data); } }); var yh = $("#yonghuming").width(); var zx = $("#zhuxiao").width(); var hyzx = $("#huiyuanzhx").width(); var dl = $("#dl").width(); var zc = $("#zc").width(); $("#dlxx").width(yh+zx+hyzx+dl+zc+26); $("#dl").click(function(){ window.location.href="login2.php"; }); $("#zc").click(function(){ window.location.href="zhuce.php"; }); $("#zhuxiao").click(function(){ $.ajax({ url:"./chuli/htshjchuli.php", data:{tp:5}, type:"POST", success: function(data){ window.location.href="login2.php"; } }); }); $("#huiyuanzhx").click(function(){ window.location.href="yhfukuanjilu.php"; }); $("#yonghuming").click(function(){ window.location.href="xiugaimm.php"; }); $("#logo").click(function(){ window.location.href="main.php"; }); $(".dhl").click(function(){ var code = $(this).attr("code"); window.location.href="buju.php?code="+code+""; }); } </script> </body> </html>
下面是mainchuli
<?php include("../DBDA.class.php"); $db=new DBDA(); $id=$_GET['code']; $sql="select main_vid from main where code='{$id}'"; $attr=$db->Query($sql); foreach($attr as $v){ $v[0]; } ?>
下面是导航处理dhchuli。php
<?php include("../DBDA.class.php"); $db=new DBDA(); $sql="select * from leibie"; $sj = $db->StrQuery($sql); echo $sj; ?>