header("Content-type:text/html;charset=utf-8"); include("../lib/config.php"); include("../lib/function.php"); $link=conndb($datebase_write); $item=$_GET['item']; if (strtolower($_GET['s'])=='n') { $item=numrotstr($item); $sql="select * from partnumber where id=$item limit 0,1"; $res = mysql_query($sql,$link) or die(mysqlErr($query,$link)); $rs_number = mysql_fetch_assoc($res); $pid=$rs_number['item']; } else { $pid=$item; } $IDfag=substr($pid,0,2); mysql_select_db('user_pro',$link) or die("Select Datebase Error: " . mysql_error()); $clientID = '0'; $lang='cn'; $query = sprintf("select userid from `id".$IDfag."` where pid='%d'",$pid); //$result = mysql_query($query,$link) or die(showBuy($lang,$item)); $result = mysql_query($query,$link); if ($result) while($row = mysql_fetch_assoc($result)){ $clientID.=','.$row['userid']; } $clientID = ltrim($clientID,','); mysql_select_db($datebase["db"],$link) or die("Select Datebase Error: " . mysql_error()); $i=0; $query = sprintf("select count(*) as num from `user_info` where ispromotion=1 and period >NOW() and userid in (%s)",$clientID); $result = mysql_query($query,$link) or die("查询异常中断2 : ".$query); $row = mysql_fetch_assoc($result); $total=$row['num']; $totalpage=ceil($total/11); $page=$_GET['page']; if ($page=='') $page=1; $query = sprintf("select * from `user_info` where ispromotion=1 and period >NOW() and userid in (%s) order by integral desc limit ".(($page-1)*11).",11",$clientID); //echo $query; $result = mysql_query($query,$link) or die("查询异常中断2 : ".$query); while($row = mysql_fetch_assoc($result)){ if($i % 2 ==0) $divid='l'; else $divid='r'; $xml = ROOT.'/2008/cache/client/'.$row['username'].'.xml'; if(!file_exists($xml)){ continue; } $doc = new DOMDocument(); $doc->load($xml); $rows = $doc->getElementsByTagName( "item" ); foreach($rows as $node){ $company = $node->getElementsByTagName($lang."_company" )->item(0)->nodeValue; if(empty($company)) $company = $node->getElementsByTagName( "en_company" )->item(0)->nodeValue; $phone = $node->getElementsByTagName($lang."_phone" )->item(0)->nodeValue; if(empty($phone)) $phone = $node->getElementsByTagName( "en_phone" )->item(0)->nodeValue; $email = $node->getElementsByTagName($lang."_email" )->item(0)->nodeValue; if(empty($email)) $email = $node->getElementsByTagName( "en_email" )->item(0)->nodeValue; $msn = $node->getElementsByTagName($lang."_msn" )->item(0)->nodeValue; if(empty($msn)) $msn = $node->getElementsByTagName( "en_msn" )->item(0)->nodeValue; $address = $node->getElementsByTagName($lang."_address" )->item(0)->nodeValue; if(empty($address)) $address = $node->getElementsByTagName( "en_address" )->item(0)->nodeValue; $url = $node->getElementsByTagName("url" )->item(0)->nodeValue; $url = trim($url); $Makes = $node->getElementsByTagName( "Makes" )->item(0)->nodeValue; $Part = $node->getElementsByTagName( "Part" )->item(0)->nodeValue; } $PC = getCityName($row['province'],$row['city']); $logo = 'http://yiparts.com/2008/pic/ClientLogo/small/'.$row['username'].'.gif'; $urlstr=$url; if(strpos($url,'http://')===false) $url='http://'.$url; if(!empty($company)){ $phone=preg_replace('/\s{2,}| /',' ',strip_tags($phone)); $phone=str_replace(' ','',$phone); $ClientList.='