0 ".$sesxh." order by xh desc";mysql_query("SET NAMES 'GBK'");$resxh=mysql_query($sqlxh); if($rowxh=mysql_fetch_array($resxh)){$nxh=$rowxh[xh]+1;}else{$nxh=1;} return $nxh; } function returncount($ctable){ global $conn; $sqlcount="select count(*) as id from ".$ctable; mysql_query("SET NAMES 'GBK'");$rescount=mysql_query($sqlcount,$conn);$rowcount=mysql_fetch_array($rescount);return intval($rowcount[id]); } function returnsum($zd,$t){ $sqlb="select sum(".$zd.") as allzd from ".$t;mysql_query("SET NAMES 'GBK'");$resb=mysql_query($sqlb);$rowb=mysql_fetch_array($resb); if(empty($rowb[allzd])){return "0";}else{return $rowb[allzd];} } function returnhelptype($tv,$tid){ $sqltype="select * from yjcode_helptype where id=".$tid."";mysql_query("SET NAMES 'GBK'");$restype=mysql_query($sqltype); $rowtype=mysql_fetch_array($restype); if($tv==1){return $rowtype[name1];}else{return $rowtype[name2];} } function returnnewstype($tyid,$wv){ global $res3; if($tyid==1){while3("id,name1","yjcode_newstype where id=".$wv);if($row3=mysql_fetch_array($res3)){return $row3[name1];}else{return "";}} if($tyid==2){while3("id,name2","yjcode_newstype where id=".$wv);if($row3=mysql_fetch_array($res3)){return $row3[name2];}else{return "";}} } function returntasktype($tv,$tid){ if(empty($tid)){return "";} $sqltype="select * from yjcode_tasktype where id=".$tid."";mysql_query("SET NAMES 'GBK'");$restype=mysql_query($sqltype); $rowtype=mysql_fetch_array($restype); if($tv==1){return $rowtype[name1];}else{return $rowtype[name2];} } function returntype($jbid,$aid){ if(empty($aid)){$aid=0;} $sqlp="select * from yjcode_type where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp); if($rowp=mysql_fetch_array($resp)){ if($jbid==1){return $rowp[type1];} elseif($jbid==2){return $rowp[type2];} elseif($jbid==3){return $rowp[type3];} elseif($jbid==4){return $rowp[type4];} elseif($jbid==5){return $rowp[type5];} }else{return "";} } function returnservertype($jbid,$aid){ if(empty($aid)){$aid=0;} $sqlp="select * from yjcode_servertype where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp); if($rowp=mysql_fetch_array($resp)){ if($jbid==1){return $rowp[name1];} elseif($jbid==2){return $rowp[name2];} }else{return "";} } function returntypem($jbid,$aid){ if(empty($aid)){$aid=0;} $sqlp="select * from yjcode_protype where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp); if($rowp=mysql_fetch_array($resp)){ if($jbid==1){return $rowp[name1];} elseif($jbid==2){return $rowp[name2];} }else{return "";} } function returnuserid($u){ if(empty($u)){return 0;}else{ $sqlother="select id,uid from yjcode_user where uid='".$u."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); if($rowother=mysql_fetch_array($resother)){return $rowother[id];}else{return 0;} } } function returnadmin($u){ $sqlother="select id,adminuid from yjcode_admin where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); if($rowother=mysql_fetch_array($resother)){return $rowother[adminuid];}else{return "";} } function returnsellbl($u,$pbh){ global $rowcontrol; $sbl=0; $sqlother="select id,sellbl from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);$rowother=mysql_fetch_array($resother); if(!empty($rowother[sellbl])){$sbl=$rowother[sellbl];}else{ $sqlt1="select bh,ty1id from yjcode_pro where bh='".$pbh."'";mysql_query("SET NAMES 'GBK'");$rest1=mysql_query($sqlt1); if($rowt1=mysql_fetch_array($rest1)){ $sqlt2="select id,sellbl from yjcode_type where id=".$rowt1[ty1id];mysql_query("SET NAMES 'GBK'");$rest2=mysql_query($sqlt2); if($rowt2=mysql_fetch_array($rest2)){ if(!empty($rowt2[sellbl])){$sbl=$rowt2[sellbl];} } } } if(!empty($sbl)){return $sbl;}else{return $rowcontrol[sellbl];} } function returnuser($uid){ if(empty($uid)){return "";} $sqlother="select id,uid from yjcode_user where id=".$uid;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[uid]; } function returnemail($uid){ global $conn; if(empty($uid)){return "";} $sqlother="select uid,email from yjcode_user where uid='".$uid."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother,$conn); if($rowother=mysql_fetch_array($resother)){return $rowother[email];}else{return "";} } function returnqq($u){ $sqlother="select id,uqq from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[uqq]; } function returnweixin($u){ $sqlother="select id,weixin from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[weixin]; } function returntjuserid($u){ $sqlother="select id,tjuserid from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); if(empty($rowother[tjuserid])){$v=0;}else{$v=$rowother[tjuserid];} return $v; } function returnnc($u){ $sqlother="select id,nc from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[nc]; } function returnproid($b){ $sqlother="select id,bh from yjcode_pro where bh='".$b."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[id]; } function returnserverid($b){ $sqlother="select id,bh from yjcode_server where bh='".$b."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother); $rowother=mysql_fetch_array($resother); return $rowother[id]; } function returnxy($u,$t){ //1卖家 2买家 if(1==$t){$sqlxy="select count(*) as id from yjcode_order where selluserid=".$u." and ddzt='suc'";} elseif(2==$t){$sqlxy="select count(*) as id from yjcode_order where userid=".$u." and ddzt='suc'";} mysql_query("SET NAMES 'GBK'");$resxy=mysql_query($sqlxy); $rowxy=mysql_fetch_array($resxy); return $rowxy[id]; } function adwhile($adbh,$adnum=0,$w=0,$h=0){ global $rowcontrol; autoAD($adbh); $li=""; if($adnum!=0){$li=" limit ".$adnum;} $sqlad="select * from yjcode_ad where zt=0 and adbh='".$adbh."' order by xh asc".$li; mysql_query("SET NAMES 'GBK'"); $resad=mysql_query($sqlad); while($rowad=mysql_fetch_array($resad)){ switch($rowad[type1]){ case "代码": echo "