showmessage.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?php
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:查看信息
- */
- error_reporting(0);
- $mid = $_GET['mid'];
- require("../../config.php");
- require("../../class/mysql_class.php");
- require("../../class/template_class.php");
- require_once("../../function/checkModuleSession.php");
- $bbwps_admin=isLogin("../../$sessionPath/");
- $db= new DB($hostname,$username,$password,$database);
- $p=new template("template");
- $sql = $db->query("select ".$prefix."message.title,".$prefix."message.cid,".$prefix."message.sid,content,picture,oprice,nprice,btime,etime,cname,sname from ".$prefix."message left join ".$prefix."city
- on ".$prefix."message.cid=".$prefix."city.cid left join ".$prefix."sort on ".$prefix."message.sid=".$prefix."sort.sid where mid ='".$mid."'",1);
- $result=$db->fetch_array($sql);
- $content = str_replace("<br />","n",$result["content"]);
- $i = floor(($result["etime"]-$result["btime"])/(3600*24));
- $p->set_var(array("mid"=> $mid,"title_value"=> $result["title"])); //传参和标题
- $sql1=$db->query("select cid,cname from ".$prefix."city where clevel='0'",1); //城市
- $p->set_file("handle","showmessage.html");
- $p->set_block("handle","op","a");
- $p->set_block("op","ap","b");
- while($row1=$db->fetch_array($sql1)){ //一级城市
- $p->set_var(array("b"=> "","value1"=> $row1["cid"],"name1"=> "|-".$row1["cname"]));
- if($result["cid"]==$row1["cid"])
- $p->set_var("selected1",selected);
- else
- $p->set_var("selected1","");
- $result1=$db->query("select cid,cname from ".$prefix."city where cparent='".$row1["cid"]."'",1);
- while($row2=$db->fetch_array($result1)){ //二级城市
- $p->set_var(array("value2"=> $row2["cid"],"name2"=> " "." "."|-".$row2["cname"]));
- if($result["cid"]==$row2["cid"])
- $p->set_var("selected2",selected);
- else
- $p->set_var("selected2","");
- $p->parse("b","ap",true);
- }
- $p->parse("a","op",true);
- }
- $result2=$db->query("select sname,sid from ".$prefix."sort where slevel = '0'",1); //分类
- $p->set_block("handle","ep","c");
- $p->set_block("ep","bp","d");
- while($cel1=$db->fetch_array($result2)){ //一级分类
- $p->set_var(array("d"=> "","value3"=> $cel1["sid"],"name3"=> "|-".$cel1["sname"]));
- if($result["sid"]==$cel1["sid"])
- $p->set_var("selected3",selected);
- else
- $p->set_var("selected3","");
- $sql2=$db->query("select sname,sid from ".$prefix."sort where sparent = '".$cel1["sid"]."'",1);
- while($cel2=mysql_fetch_array($sql2)){ //二级分类
- $p->set_var(array("value4"=> $cel2["sid"],"name4"=> " "." "."|-".$cel2["sname"]));
- if($result["sid"]==$cel2["sid"])
- $p->set_var("selected4",selected);
- else
- $p->set_var("selected4","");
- $p->parse("d","bp",true);
- }
- $p->parse("c","ep",true);
- }
- $p->set_block("handle","mp","e");
- if($result["picture"]){ //信息图片
- $handle = explode(".",$result["picture"]);
- $file = date("Y-m-j",$handle[0]);
- $p->set_var(array("file"=> $file,"picture"=> $result["picture"]));
- $p->parse("e","mp",true);
- }
- $p->set_var(array("oprice"=> $result["oprice"],"nprice"=> $result["nprice"],"btime"=> date("Y-m-j",$result["btime"]),"day"=> $i,"cont_value"=> $content));
- $p->parse("showmessage","handle");
- $p->p("showmessage");
- $db->close();
- ?>