return.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <?php
  2. /*
  3. 2014年起,友价团队全部源码不再做加密处理,全部开源,方便用户二次开发。
  4. 同时我们仅对正规渠道购买的用户提供技术支持。
  5. 另:如果源码购买后有转卖行为,我们即删除你的认证帐号,同时也不再提供任何支持。
  6. yj.928vip.cn
  7. 友价源码
  8. */
  9. require("return1.php");
  10. function panduan($pzd,$ptable){
  11. global $conn;
  12. $sqlpd="select ".$pzd." from ".$ptable;mysql_query("SET NAMES 'GBK'");$respd=mysql_query($sqlpd,$conn);
  13. if($rowpd=mysql_fetch_array($respd)){return 1;}else{return 0;}
  14. }
  15. function returnxh($tabxh,$sesxh=""){
  16. $sqlxh="select * from ".$tabxh." where id<>0 ".$sesxh." order by xh desc";mysql_query("SET NAMES 'GBK'");$resxh=mysql_query($sqlxh);
  17. if($rowxh=mysql_fetch_array($resxh)){$nxh=$rowxh[xh]+1;}else{$nxh=1;}
  18. return $nxh;
  19. }
  20. function returncount($ctable){
  21. global $conn;
  22. $sqlcount="select count(*) as id from ".$ctable;
  23. mysql_query("SET NAMES 'GBK'");$rescount=mysql_query($sqlcount,$conn);$rowcount=mysql_fetch_array($rescount);return intval($rowcount[id]);
  24. }
  25. function returnsum($zd,$t){
  26. $sqlb="select sum(".$zd.") as allzd from ".$t;mysql_query("SET NAMES 'GBK'");$resb=mysql_query($sqlb);$rowb=mysql_fetch_array($resb);
  27. if(empty($rowb[allzd])){return "0";}else{return $rowb[allzd];}
  28. }
  29. function returnhelptype($tv,$tid){
  30. $sqltype="select * from yjcode_helptype where id=".$tid."";mysql_query("SET NAMES 'GBK'");$restype=mysql_query($sqltype);
  31. $rowtype=mysql_fetch_array($restype);
  32. if($tv==1){return $rowtype[name1];}else{return $rowtype[name2];}
  33. }
  34. function returnnewstype($tyid,$wv){
  35. global $res3;
  36. if($tyid==1){while3("id,name1","yjcode_newstype where id=".$wv);if($row3=mysql_fetch_array($res3)){return $row3[name1];}else{return "";}}
  37. if($tyid==2){while3("id,name2","yjcode_newstype where id=".$wv);if($row3=mysql_fetch_array($res3)){return $row3[name2];}else{return "";}}
  38. }
  39. function returntasktype($tv,$tid){
  40. if(empty($tid)){return "";}
  41. $sqltype="select * from yjcode_tasktype where id=".$tid."";mysql_query("SET NAMES 'GBK'");$restype=mysql_query($sqltype);
  42. $rowtype=mysql_fetch_array($restype);
  43. if($tv==1){return $rowtype[name1];}else{return $rowtype[name2];}
  44. }
  45. function returntype($jbid,$aid){
  46. if(empty($aid)){$aid=0;}
  47. $sqlp="select * from yjcode_type where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp);
  48. if($rowp=mysql_fetch_array($resp)){
  49. if($jbid==1){return $rowp[type1];}
  50. elseif($jbid==2){return $rowp[type2];}
  51. elseif($jbid==3){return $rowp[type3];}
  52. elseif($jbid==4){return $rowp[type4];}
  53. elseif($jbid==5){return $rowp[type5];}
  54. }else{return "";}
  55. }
  56. function returnservertype($jbid,$aid){
  57. if(empty($aid)){$aid=0;}
  58. $sqlp="select * from yjcode_servertype where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp);
  59. if($rowp=mysql_fetch_array($resp)){
  60. if($jbid==1){return $rowp[name1];}
  61. elseif($jbid==2){return $rowp[name2];}
  62. }else{return "";}
  63. }
  64. function returntypem($jbid,$aid){
  65. if(empty($aid)){$aid=0;}
  66. $sqlp="select * from yjcode_protype where id=".$aid;mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp);
  67. if($rowp=mysql_fetch_array($resp)){
  68. if($jbid==1){return $rowp[name1];}
  69. elseif($jbid==2){return $rowp[name2];}
  70. }else{return "";}
  71. }
  72. function returnuserid($u){
  73. if(empty($u)){return 0;}else{
  74. $sqlother="select id,uid from yjcode_user where uid='".$u."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  75. if($rowother=mysql_fetch_array($resother)){return $rowother[id];}else{return 0;}
  76. }
  77. }
  78. function returnadmin($u){
  79. $sqlother="select id,adminuid from yjcode_admin where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  80. if($rowother=mysql_fetch_array($resother)){return $rowother[adminuid];}else{return "";}
  81. }
  82. function returnsellbl($u,$pbh){
  83. global $rowcontrol;
  84. $sbl=0;
  85. $sqlother="select id,sellbl from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);$rowother=mysql_fetch_array($resother);
  86. if(!empty($rowother[sellbl])){$sbl=$rowother[sellbl];}else{
  87. $sqlt1="select bh,ty1id from yjcode_pro where bh='".$pbh."'";mysql_query("SET NAMES 'GBK'");$rest1=mysql_query($sqlt1);
  88. if($rowt1=mysql_fetch_array($rest1)){
  89. $sqlt2="select id,sellbl from yjcode_type where id=".$rowt1[ty1id];mysql_query("SET NAMES 'GBK'");$rest2=mysql_query($sqlt2);
  90. if($rowt2=mysql_fetch_array($rest2)){
  91. if(!empty($rowt2[sellbl])){$sbl=$rowt2[sellbl];}
  92. }
  93. }
  94. }
  95. if(!empty($sbl)){return $sbl;}else{return $rowcontrol[sellbl];}
  96. }
  97. function returnuser($uid){
  98. if(empty($uid)){return "";}
  99. $sqlother="select id,uid from yjcode_user where id=".$uid;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  100. $rowother=mysql_fetch_array($resother);
  101. return $rowother[uid];
  102. }
  103. function returnemail($uid){
  104. global $conn;
  105. if(empty($uid)){return "";}
  106. $sqlother="select uid,email from yjcode_user where uid='".$uid."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother,$conn);
  107. if($rowother=mysql_fetch_array($resother)){return $rowother[email];}else{return "";}
  108. }
  109. function returnqq($u){
  110. $sqlother="select id,uqq from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  111. $rowother=mysql_fetch_array($resother);
  112. return $rowother[uqq];
  113. }
  114. function returnweixin($u){
  115. $sqlother="select id,weixin from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  116. $rowother=mysql_fetch_array($resother);
  117. return $rowother[weixin];
  118. }
  119. function returntjuserid($u){
  120. $sqlother="select id,tjuserid from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  121. $rowother=mysql_fetch_array($resother);
  122. if(empty($rowother[tjuserid])){$v=0;}else{$v=$rowother[tjuserid];}
  123. return $v;
  124. }
  125. function returnnc($u){
  126. $sqlother="select id,nc from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  127. $rowother=mysql_fetch_array($resother);
  128. return $rowother[nc];
  129. }
  130. function returnproid($b){
  131. $sqlother="select id,bh from yjcode_pro where bh='".$b."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  132. $rowother=mysql_fetch_array($resother);
  133. return $rowother[id];
  134. }
  135. function returnserverid($b){
  136. $sqlother="select id,bh from yjcode_server where bh='".$b."'";mysql_query("SET NAMES 'GBK'");$resother=mysql_query($sqlother);
  137. $rowother=mysql_fetch_array($resother);
  138. return $rowother[id];
  139. }
  140. function returnxy($u,$t){ //1卖家 2买家
  141. if(1==$t){$sqlxy="select count(*) as id from yjcode_order where selluserid=".$u." and ddzt='suc'";}
  142. elseif(2==$t){$sqlxy="select count(*) as id from yjcode_order where userid=".$u." and ddzt='suc'";}
  143. mysql_query("SET NAMES 'GBK'");$resxy=mysql_query($sqlxy);
  144. $rowxy=mysql_fetch_array($resxy);
  145. return $rowxy[id];
  146. }
  147. function adwhile($adbh,$adnum=0,$w=0,$h=0){
  148. global $rowcontrol;
  149. autoAD($adbh);
  150. $li="";
  151. if($adnum!=0){$li=" limit ".$adnum;}
  152. $sqlad="select * from yjcode_ad where zt=0 and adbh='".$adbh."' order by xh asc".$li;
  153. mysql_query("SET NAMES 'GBK'");
  154. $resad=mysql_query($sqlad);
  155. while($rowad=mysql_fetch_array($resad)){
  156. switch($rowad[type1]){
  157. case "代码":
  158. echo "<div class=\"ad1\">$rowad[txt]</div>";
  159. break;
  160. case "图片":
  161. $s="";
  162. if($w!=0){$s=" width=\"".$w."px;\"";}
  163. if($h!=0){$s=$s." height=\"".$h."px;\"";}
  164. echo "<div class=\"ad1\"><a href=\"".$rowad[aurl]."\" target=_blank><img alt=\"".$rowad[tit]."\"".$s." border=0 src=".weburl.returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".".$rowad[jpggif]."></a></div>";
  165. break;
  166. case "文字":
  167. echo "<div class=\"ad1\">·<a href=\"".$rowad[aurl]."\" target=_blank>".$rowad[utit]."</a></div>";
  168. break;
  169. case "动画":
  170. echo "<div class=\"ad1\"><embed src=\"".weburl."/".returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".swf\" quality=\"high\" width=\"".$rowad[aw]."\" height=\"".$rowad[ah]."\" wmode=transparent type=\"application/x-shockwave-flash\"></embed></div>";
  171. break;
  172. }
  173. }
  174. }
  175. function adread($adbh,$w,$h){
  176. global $rowcontrol;
  177. autoAD($adbh);
  178. $sqlad="select * from yjcode_ad where zt=0 and adbh='".$adbh."'";
  179. mysql_query("SET NAMES 'GBK'");
  180. $resad=mysql_query($sqlad);
  181. if($rowad=mysql_fetch_array($resad)){
  182. switch($rowad[type1]){
  183. case "代码":
  184. echo "$rowad[txt]";
  185. break;
  186. case "图片":
  187. if($h==0 || $w==0){
  188. echo "<a href=\"".$rowad[aurl]."\" target=_blank><img border=0 src=".weburl.returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".".$rowad[jpggif]."></a>";
  189. }else{
  190. echo "<a href=$rowad[aurl] target=_blank><img border=0 src=".weburl.returnjgdw($rowcontrol[addir],"","gg")."/$rowad[bh].$rowad[jpggif] width=$w height=$h></a>";
  191. }
  192. break;
  193. case "文字":
  194. echo "<a href=\"".$rowad[aurl]."\" target=_blank>".$rowad[tit]."</a>";
  195. break;
  196. case "动画":
  197. echo "<div class=\"ad\"><embed src=\"".weburl.returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".swf\" quality=\"high\" width=\"".$rowad[aw]."\" height=\"".$rowad[ah]."\" wmode=transparent type=\"application/x-shockwave-flash\"></embed></div>";
  198. break;
  199. }
  200. }
  201. }
  202. function adreadID($adid,$w,$h){
  203. global $rowcontrol;
  204. $sqlad="select * from yjcode_ad where zt=0 and id=".$adid;
  205. mysql_query("SET NAMES 'GBK'");
  206. $resad=mysql_query($sqlad);
  207. if($rowad=mysql_fetch_array($resad)){
  208. switch($rowad[type1]){
  209. case "代码":
  210. echo "$rowad[txt]";
  211. break;
  212. case "图片":
  213. if($h==0 || $w==0){
  214. echo "<a href=\"".$rowad[aurl]."\" target=_blank><img border=0 src=".weburl.returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".".$rowad[jpggif]."></a>";
  215. }else{
  216. echo "<a href=$rowad[aurl] target=_blank><img border=0 src=".weburl.returnjgdw($rowcontrol[addir],"","gg")."/$rowad[bh].$rowad[jpggif] width=$w height=$h></a>";
  217. }
  218. break;
  219. case "文字":
  220. echo "·<a href=\"".$rowad[aurl]."\" target=_blank>".$rowad[utit]."</a>";
  221. break;
  222. case "动画":
  223. echo "<div class=\"ad\"><embed src=\"".weburl.returnjgdw($rowcontrol[addir],"","gg")."/".$rowad[bh].".swf\" quality=\"high\" width=\"".$rowad[aw]."\" height=\"".$rowad[ah]."\" wmode=transparent type=\"application/x-shockwave-flash\"></embed></div>";
  224. break;
  225. }
  226. }
  227. }
  228. function returntp($tsql,$a=""){
  229. $sqltp="select * from yjcode_tp where ".$tsql;mysql_query("SET NAMES 'GBK'");$restp=mysql_query($sqltp);
  230. if($rowtp=mysql_fetch_array($restp)){
  231. if(empty($rowtp[upty])){
  232. $t=preg_split("/\./",$rowtp[tp]);return weburl.$t[0].$a.".".$t[1];
  233. }else{
  234. return returnnotp($rowtp[tp],$a);
  235. }
  236. }else{
  237. return "";
  238. }
  239. }
  240. function returnuserdj($u){
  241. $fdj="";
  242. $sqld="select * from yjcode_userdj where zt=0 order by xh asc";mysql_query("SET NAMES 'GBK'");$resd=mysql_query($sqld);
  243. if($rowd=mysql_fetch_array($resd)){$fdj=$rowd[name1];}else{$fdj="";}
  244. $sqlu="select * from yjcode_user where id=".$u;mysql_query("SET NAMES 'GBK'");$resu=mysql_query($sqlu);$rowu=mysql_fetch_array($resu);
  245. if(empty($rowu[userdj])){
  246. $ldj=$fdj;
  247. }else{
  248. $ldj=$rowu[userdj];
  249. }
  250. if(!empty($rowu[userdjdq])){
  251. $sj1=date("Y-m-d H:i:s");
  252. if($rowu[userdjdq]<$sj1){$ldj=$fdj;$dq=date('Y-m-d H:i:s',strtotime ("-10 second",strtotime($sj1)));updatetable("yjcode_user","userdj='".$fdj."',userdjdq=NULL where id=".$u);}
  253. }
  254. return $ldj;
  255. }
  256. function returnarea($abh){
  257. if(0==$abh){return "";}else{
  258. $sqlarea="select bh,name1 from yjcode_city where bh='".$abh."'";mysql_query("SET NAMES 'GBK'");$resarea=mysql_query($sqlarea);
  259. $rowarea=mysql_fetch_array($resarea);
  260. return $rowarea[name1];
  261. }
  262. }
  263. function returnyunfei($u,$s,$sl,$p){//u商家 s买家收货ID sl数量 p商品编号
  264. $resu=0;
  265. if(empty($s)){$resu=0;}
  266. $sqlyf="select * from yjcode_shdz where id=".$s;mysql_query("SET NAMES 'GBK'");$resyf=mysql_query($sqlyf);
  267. if($rowyf=mysql_fetch_array($resyf)){$a1=$rowyf[add1];$a2=$rowyf[add2];$a3=$rowyf[add3];}
  268. $s="|".$a1.",".$a2.",".$a3."|";
  269. $sqlyf="select * from yjcode_yunfei where cityid like '%".$s."%' and userid=".$u." order by money1 asc";mysql_query("SET NAMES 'GBK'");$resyf=mysql_query($sqlyf);
  270. if($rowyf=mysql_fetch_array($resyf)){$m1=$rowyf[money1];$m2=$rowyf[money2];}
  271. $s="|".$a1.",".$a2.",0|";
  272. $sqlyf="select * from yjcode_yunfei where cityid like '%".$s."%' and userid=".$u." order by money1 asc";mysql_query("SET NAMES 'GBK'");$resyf=mysql_query($sqlyf);
  273. if($rowyf=mysql_fetch_array($resyf)){$m1=$rowyf[money1];$m2=$rowyf[money2];}
  274. $s="|".$a1.",0,0|";
  275. $sqlyf="select * from yjcode_yunfei where cityid like '%".$s."%' and userid=".$u." order by money1 asc";mysql_query("SET NAMES 'GBK'");$resyf=mysql_query($sqlyf);
  276. if($rowyf=mysql_fetch_array($resyf)){$m1=$rowyf[money1];$m2=$rowyf[money2];}
  277. $s="|0,0,0|";
  278. $sqlyf="select * from yjcode_yunfei where cityid like '%".$s."%' and userid=".$u." order by money1 asc";mysql_query("SET NAMES 'GBK'");$resyf=mysql_query($sqlyf);
  279. if($rowyf=mysql_fetch_array($resyf)){$m1=$rowyf[money1];$m2=$rowyf[money2];}
  280. $sqlp="select * from yjcode_pro where bh='".$p."'";mysql_query("SET NAMES 'GBK'");$resp=mysql_query($sqlp);$rowp=mysql_fetch_array($resp);
  281. if(5==$rowp[fhxs]){
  282. $zz=$rowp[zl]*$sl;//总量
  283. if($zz<=1){$resu=$m1;}else{
  284. $resu=ceil($zz-1)*$m2+$m1;
  285. }
  286. }else{$resu=0;}
  287. if(is_numeric($resu)){return $resu;}else{return 0;}
  288. }
  289. function returntjmoney($pbh){
  290. global $rowcontrol;
  291. $tjmv=0;
  292. $sqlt1="select bh,ty1id from yjcode_pro where bh='".$pbh."'";mysql_query("SET NAMES 'GBK'");$rest1=mysql_query($sqlt1);
  293. if($rowt1=mysql_fetch_array($rest1)){
  294. $sqlt2="select id,tjmoney from yjcode_type where id=".$rowt1[ty1id];mysql_query("SET NAMES 'GBK'");$rest2=mysql_query($sqlt2);
  295. if($rowt2=mysql_fetch_array($rest2)){
  296. if(!empty($rowt2[tjmoney])){$tjmv=$rowt2[tjmoney];}
  297. }
  298. }
  299. if(!empty($tjmv)){return $tjmv;}else{return $rowcontrol[tjmoney];}
  300. }
  301. function returnvideo($a,$w,$h){
  302. $sqlt1="select * from yjcode_provideo where id=".intval($a);mysql_query("SET NAMES 'GBK'");$rest1=mysql_query($sqlt1);
  303. if($rowt1=mysql_fetch_array($rest1)){
  304. if($rowt1[admin]==1){$u=$rowt1[url];}else{$u=str_replace("../upload/","upload/",weburl.$rowt1[url]);}
  305. if($rowt1[gs]=="flv"){
  306. $str="
  307. <script type=\"text/javascript\">var swf_width=".$w.";var swf_height=".$h.";var texts='';var files='".$u."';
  308. document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+ swf_width +'\" height=\"'+ swf_height +'\">');
  309. document.write('<param name=\"movie\" value=\"".weburl."config/flv.swf\"><param name=\"quality\" value=\"high\">');
  310. document.write('<param name=\"menu\" value=\"false\"><param name=\"allowFullScreen\" value=\"true\" />');
  311. document.write('<param name=\"FlashVars\" value=\"vcastr_file='+files+'&IsAutoPlay=1\">');
  312. document.write('<embed src=\"".weburl."config/flv.swf\" allowFullScreen=\"true\" FlashVars=\"vcastr_file='+files+'&vcastr_title='+texts+'\" menu=\"false\" quality=\"high\" width=\"'+ swf_width +'\" height=\"'+ swf_height +'\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');
  313. document.write('</object>');
  314. </script>
  315. ";
  316. }elseif($rowt1[gs]=="swf"){
  317. $str="<embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"".$u."\" width=\"".$w."\" height=\"".$h."\" style=\"float: none\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/>";
  318. }
  319. }
  320. return $str;
  321. }
  322. ?>