add.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?php
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:添加信息
- */
- require("./global.php");
- $cid = $_GET['cid'];
- $sid = $_GET['sid'];
- $sql=$db->query("select cid,cname from ".$prefix."city where clevel='0'" ,1);
- $p->set_file("handle","add.html");
- $p->set_block("handle","op","a");
- $p->set_block("op","ap","b");
- //***********一级城市**************
- while($row=$db->fetch_array($sql)){
- $p->set_var(array("b"=> "","value1"=> $row["cid"]));
- $result=$db->query("select cid,cname from ".$prefix."city where cparent='".$row["cid"]."'",1);
- if($cid==$row["cid"])
- $p->set_var("selected1",selected);
- else
- $p->set_var("selected1","");
- $p->set_var("name1","|-".$row["cname"]);
- //***********二级城市**************
- while($cel=$db->fetch_array($result)){
- $p->set_var(array("value2"=> $cel["cid"],"name2"=> " "." "."|-".$cel["cname"]));
- if($cid==$cel["cid"])
- $p->set_var("selected2",selected);
- else
- $p->set_var("selected2","");
- $p->parse("b","ap",true);
- }
- $p->parse("a","op",true);
- }
- $sql1=$db->query("select sname,sid from ".$prefix."sort where slevel = '0' order by ".$prefix."sort.seq desc ",1);
- $p->set_block("handle","ep","c");
- $p->set_block("ep","bp","d");
- //***********一级分类**************
- while($row1=$db->fetch_array($sql1)){
- $p->set_var(array("d"=> "","value3"=> $row1["sid"],"name3"=> "|-".$row1["sname"]));
- if($sid==$row1["sid"])
- $p->set_var("selected3",selected);
- else
- $p->set_var("selected3","");
- $result1=$db->query("select sname,sid from ".$prefix."sort where sparent = '".$row1["sid"]."'",1);
- //***********二级分类**************
- while($cel1=$db->fetch_array($result1)){
- $p->set_var(array("value4"=> $cel1["sid"],"name4"=> " "." "."|-".$cel1["sname"]));
- if($sid==$cel1["sid"])
- $p->set_var("selected4",selected);
- else
- $p->set_var("selected4","");
- $p->parse("d","bp",true);
- }
- $p->parse("c","ep",true);
- }
- $p->set_var("date",date("Y-m-j",time()));
- $p->parse("work","handle");
- require_once("head.php");
- $db->close();
- ?>