예제 #1
0
 public function upshow()
 {
     $str = getTypep();
     $id = (int) $_GET['id'];
     $mOb = M("product");
     $re = $mOb->where("id={$id}")->find();
     $this->assign('str', $str);
     $this->assign('re', $re);
     $this->display();
 }
예제 #2
0
function getTypep($fid = 0, $valueStr = "", $num = 0)
{
    $mOb = M('Type');
    $arr = $mOb->where("fid={$fid} and state=0")->select();
    $optionStr = "";
    $indentStr = str_repeat("--", $num);
    $num++;
    $valueStr .= $fid . ">";
    foreach ($arr as $v) {
        $optionStr .= "<option value='{$valueStr}{$v['id']}>'>{$indentStr}{$v['tname']}</option>";
        $reStr = getTypep($v['id'], $valueStr, $num);
        $optionStr .= $reStr;
    }
    return $optionStr;
}