query($sqlsearch); $totalsearch = mysql_num_rows($resultsearch); $rssearch = $db->query($sqlsearch); while($rowsearch = $db->fetch_array($rssearch)) { $searchresulttext = $rowsearch["searhcatname"]; $sql_productphoto = "SELECT * FROM attachment WHERE table_name='products' and table_id ='".$rowsearch["id"]."'"; $rs_productphoto = $db->query($sql_productphoto); $productphoto_list = ""; while ( $row_productphoto = $db->fetch_array($rs_productphoto)){ $photo1 = $row_productphoto["file_name"]; $photopath1 = $row_productphoto["path"]; if ( $row_productphoto["col_name"]=='Photo Small Left' ){ $photoleft = $row_productphoto["file_name"]; $photopathleft = $row_productphoto["path"]; } if ( $row_productphoto["col_name"]=='Photo Small Middle' ){ $photomiddle = $row_productphoto["file_name"]; $photopathmiddle = $row_productphoto["path"]; } if ( $row_productphoto["col_name"]=='Photo Small Right' ){ $photoright = $row_productphoto["file_name"]; $photopathright = $row_productphoto["path"]; } } $templist .= '
'.$rowsearch["{$_SESSION['lang']}_"].' - '.$rowsearch["productcode"].'

'.$rowsearch["{$_SESSION['lang']}_brief"].'


'.$_SESSION['curr'].' '.$rowsearch["price1"].'


View Details
'; } if ($totalsearch =="" ) { if ($_SESSION['lang']=="en") { $cattitle = "Found 0 iteams"; } if ($_SESSION['lang']=="tc") { $cattitle = "找到 0 iteams"; } if ($_SESSION['lang']=="sc") { $cattitle = "找到 0 iteams"; } } else { if ($_SESSION['lang']=="en") { $cattitle = "Found ".$totalsearch." iteams contains '".$srchFld."'"; } if ($_SESSION['lang']=="tc") { $cattitle = "找到 ".$totalsearch." 相关产品包括: '".$srchFld."'"; } if ($_SESSION['lang']=="sc") { $cattitle = "找到 ".$totalsearch." 相关产品包括: '".$srchFld."'"; } } } if ($pid!="") { $templist = ""; $sql = "SELECT * , (select {$_SESSION['lang']}_name from levelone where id='".$pid."') as catname , (select {$_SESSION['lang']}_name from leveltwo where id='".$psid."') as subcatname , (select {$_SESSION['lang']}_desc from leveltwo where id='".$psid."') as subcatdesc FROM products where display='1' and levelone='".$pid."' and leveltwo='".$psid."' ORDER BY sorting ASC, {$_SESSION['lang']}_name ASC"; $result=$db->query($sql.$sql_limit); $total = mysql_num_rows($result); $rs = $db->query($sql); while($row = $db->fetch_array($rs)) { $cattitle = $row["catname"]; $subcattitle = $row["subcatname"]; $subcatdesc = $row["subcatdesc"]; $sql2 = "SELECT * FROM attachment where table_name='products' and col_name='Photo Large' and table_id='".$row["id"]."' ORDER BY sorting ASC"; $rs2 = $db->query($sql2); while($row2 = $db->fetch_array($rs2)) { $filephoto = " src='../".$row2["path"]."thumb_l/".$row2["file_name"]."' "; $width = " width=".$row2["width"]." "; $height = " height=".$row2["height"]." "; $title = " title=".$row2["title"]." "; $alt = " alt='".$row2["alt"]."' "; } if ( $_SESSION['curr']=='RMB' ) { $tempunitprice = $row["price1unit"]; $tempunitprice2 .= $row["price1"] ; } if ( $_SESSION['curr']=='HKD' ) { $tempunitprice = $row["price2unit"]; $tempunitprice2 .= $row["price2"] ; } if ( $_SESSION['curr']=='USD' ) { $tempunitprice = $row["price3unit"]; $tempunitprice2 .= $row["price3"] ; } $templist .= '
'.$row["{$_SESSION['lang']}name"].'

'.$row["{$_SESSION['lang']}brief"].'


'.$_SESSION['curr'].' $ '.$row["price1"].'


View Details
'; $templist2 .= ' '; $sql2 = "SELECT * FROM leveltwo where display=1 and levelone_id='".$row["id"]."' ORDER BY sorting ASC, {$_SESSION['lang']}_name ASC"; $rs2 = $db->query($sql2); while($row2 = $db->fetch_array($rs2)) { $templist .= '
  • '.$row2["{$_SESSION['lang']}_name"].'
  • '; } $templist .= '
  • ' ; } //echo $templist; } ?>