www.gusucode.com > 4077网博士成品网站管理系统网站源码php模板代码程序 > 4077/4077/tools/admin/mark_city.php

    <?php
define("ROOTPATH", "../../");
include(ROOTPATH."includes/admin.inc.php");
include("language/".$sLan.".php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link  href="css/style.css" type="text/css" rel="stylesheet">
<title><?php echo $strAdminTitle; ?></title>
<script type="text/javascript" src="../../base/js/base.js"></script>
<script type="text/javascript" src="../../base/js/form.js"></script>
<script type="text/javascript" src="../../base/js/blockui.js"></script>
<script type="text/javascript" src="js/zlinfo.js"></script>
</head>

<body >
<?php
$step = $_REQUEST['step'];
$pid = $_REQUEST['pid'];

if(!isset($pid) || $pid==""){
$pid=0;
}


if($step=="add" && $_REQUEST["zone"]!="" && $_REQUEST["zone"]!=" "){
	$cat= $_REQUEST["zone"];
	$cat=htmlspecialchars($cat);

	if($pid!="0"){
		$msql->query("select catpath from {P}_tools_markcity where catid='$pid'");
		if($msql->next_record()){
			$pcatpath=$msql->f('catpath');
		}
	}

	$msql->query("select max(xuhao) from {P}_tools_markcity where pid='$pid'");
		if($msql->next_record()){
			$maxxuhao=$msql->f('max(xuhao)');
			$nowxuhao=$maxxuhao+1;
		}

	$msql->query("insert into {P}_tools_markcity set
	`pid`='$pid',
	`cat`='$cat',
	`xuhao`='$nowxuhao',
	`catpath`='$catpath'
	");

    $nowcatid=$msql->instid();
	$nowpath=fmpath($nowcatid);
	$catpath=$pcatpath.$nowpath.":";

	$msql->query("update {P}_tools_markcity set catpath='$catpath' where catid='$nowcatid'");

}
if($step=="del"){

	$catid=$_GET["catid"];
	$pid=$_GET["pid"];
	
	$msql->query("select catid from {P}_tools_markcity where pid='$catid'");
	if($msql->next_record()){
		err($strZlinfoNotice9,"","");
		exit;
	}
	
	$msql->query("delete from {P}_tools_markcity where catid='$catid'");


}


if($step=="modi"){
	
	$cat=$_GET["cat"];
	$catid=$_GET["catid"];
	$pid=$_GET["pid"];
	$xuhao=$_GET["xuhao"];

	$zone=htmlspecialchars($zone);

	$msql->query("update {P}_tools_markcity set cat='$cat',xuhao='$xuhao' where catid='$catid' ");

}

?> 
<div class="searchzone">
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="30">
  <tr> 
   
                  
      <td width="80"  height="30"> 
	  <select name="pid" onChange="self.location=this.options[this.selectedIndex].value">
	  <option value='mark_city.php'><?php echo $strMarkSelCat; ?></option>
         <?php
				$fsql -> query ("select * from {P}_tools_markcity order by catpath");
				while ($fsql -> next_record ()) {
					$lpid = $fsql -> f ("pid");
					$lcatid = $fsql -> f ("catid");
					$cat = $fsql -> f ("cat");
					$catpath = $fsql -> f ("catpath");
					$lcatpath = explode (":", $catpath);

					
					
						for ($i = 0; $i < sizeof ($lcatpath)-2; $i ++) {
							$tsql->query("select catid,cat from {P}_tools_markcity where catid='$lcatpath[$i]'");
							if($tsql->next_record()){
								$ncatid=$tsql->f('cat');
								$ncat=$tsql->f('cat');
								$ppcat.=$ncat."/";
							}
						}
						
						if($pid==$lcatid){
							echo "<option value='mark_city.php?pid=".$lcatid."' selected>".$ppcat.$cat."</option>";
						}else{
							echo "<option value='mark_city.php?pid=".$lcatid."'>".$ppcat.$cat."</option>";
						}
						$ppcat="";
					
					
				}
		 ?>
        </select>
        
                    
      </td>
    
             
  
      <td align="right" > <form name="addcat" method="get" action="mark_city.php"  onSubmit="return zoneCheckform(this)">
        <input type="hidden" name="step" value="add" />
        <select name="pid" id="pid" >
          <option value='0'><?php echo $strMarkTopAdd; ?></option>
          <?php
				$fsql -> query ("select * from {P}_tools_markcity order by catpath");
				while ($fsql -> next_record ()) {
					$lpid = $fsql -> f ("pid");
					$lcatid = $fsql -> f ("catid");
					$cat = $fsql -> f ("cat");
					$catpath = $fsql -> f ("catpath");
					$lcatpath = explode (":", $catpath);

					
					
						for ($i = 0; $i < sizeof ($lcatpath)-2; $i ++) {
							$tsql->query("select catid,cat from {P}_tools_markcity where catid='$lcatpath[$i]'");
							if($tsql->next_record()){
								$ncatid=$tsql->f('cat');
								$ncat=$tsql->f('cat');
								$ppcat.=$ncat."&gt;";
							}
						}
						
						if($pid==$lcatid){
							echo "<option value='".$lcatid."' selected>".$strMarkLocat1.$ppcat.$cat."</option>";
						}else{
							echo "<option value='".$lcatid."'>".$strMarkLocat1.$ppcat.$cat."</option>";
						}
						$ppcat="";
					
					
				}
		 ?>
        </select>
        <input name="zone" type="text" class="input" value="<?php echo $strSetMarkCity; ?>" size="15" onFocus="this.value=''" />
        <input type="Submit" name="Submit" value="<?php echo $strMarkAdd;?>" class="button" />
      </form>
	</td> 
  </tr>
</table>

</div>

<div class="listzone">

<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr>
    <td width="38"  class="biaoti"><?php echo $strNumber; ?></td> 
    <td width="38"  class="biaoti"><?php echo $strXuhao; ?></td>
    <td width="135"  class="biaoti"><?php echo $strTopCat; ?> </td>
    <td width="60"  class="biaoti"><?php echo $strModify; ?></td>
    <td width="60"  class="biaoti"><?php echo $strDelete; ?></td>
  </tr>
  <?php
$msql->query("select * from {P}_tools_markcity where  pid='$pid' order by xuhao");

while($msql->next_record()){
$catid=$msql->f("catid");
$cat=$msql->f("cat");
$xuhao=$msql->f("xuhao");
$pid=$msql->f("pid");
$tj=$msql->f("tj");
$catpath=$msql->f("catpath");
$ifchannel=$msql->f("ifchannel");
if($ifchannel=="1"){
	$href="../class/".$catid."/";
	$url="http://.../zlinfo/class/".$catid."/";
}else{
	$href="../class/?".$catid.".html";;
	$url="http://.../zlinfo/class/?".$catid.".html";
}

?> 
  <tr class="list">
    <td width="38"  ><?php echo $catid; ?>
    </td> 
    <form method="get" action="mark_city.php">
      <td width="38"  > 
        <input type="text" name="xuhao" size="3" value="<?php echo $xuhao; ?>" class="input" />
      </td>
      <td width="135"  > 
        <input type="text" name="cat" size="36" value="<?php echo $cat; ?>" class="input" />
          <input type="hidden" name="catid" value="<?php echo $catid; ?>" />
        <input type="hidden" name="step" value="modi" />
        <input type="hidden" name="pid" value="<?php echo $pid; ?>" />
        
      </td>
      <td width="38"  ><input type="image"  name="imageField" src="images/modi.png" width="24" height="24" /> </td>
      <td width="38"  > <img src="images/delete.png"  style="cursor:pointer"  border=0 onClick="self.location='mark_city.php?step=del&catid=<?php echo $catid; ?>&pid=<?php echo $pid; ?>'"></td>
    </form>
  </tr>
  <?php
}
?> 
</table>
</div>

</body>
</html>