Advertisement
Guest User

Untitled

a guest
Feb 6th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.37 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function _version_key() {
  15. global $HtmlpathROOT;
  16.  
  17. $str = file_get_contents( $HtmlpathROOT . '/caches/license.cert' );
  18. return $str;
  19. }
  20.  
  21. function __autoload($class_name) {
  22. global $rootpath;
  23.  
  24. $file = $rootpath . 'include/model/' . $class_name . '.class.php';
  25.  
  26. if (!file_exists( $file )) {
  27. $file = $rootpath . 'include/class/' . $class_name . '.class.php';
  28. }
  29.  
  30. include_once( $file );
  31. }
  32.  
  33. function upfiles_is($type = 'www', $key, $name) {
  34. global $rootpath;
  35. global $rooturl;
  36.  
  37. $show .= '<script language="javascript">';
  38. $show .= 'function upload_data_' . $name . '(){';
  39. $show .= 'window.open("' . $rooturl . 'common/upload_t.php?name=' . $name . '&type=' . $type . '&val=' . $key . '","_blank","height=300, width=400, top=200,left=300, toolbar=on, menubar=on,scrollbar=on,status=on,scrollbars=on, resizable=yes, location=on, status=yes,titlebar=1");';
  40. $show .= '}';
  41. $show .= 'function upload_set_' . $name . '(id){';
  42. $show .= 'document.getElementById(\'' . $name . '\').value=id;';
  43. $show .= '}';
  44. $show .= '</script>';
  45. $show .= '<input name="' . $name . '" id="' . $name . '" class="input-text" value="' . $key . '" id="' . $name . '" style="width:310px"> <input type="button" class="button" value="¸½¼þ±à¼­" onclick="javascript:upload_data_' . $name . '()" />';
  46. return $show;
  47. }
  48.  
  49. function price_rate($id) {
  50. $class = new brand_car( );
  51. $class->wheres = 'brandid=' . $id;
  52. $str2 = $class->getList( );
  53.  
  54. foreach ($str2 as $val) {
  55. $mins = price_car_min( $val['id'] );
  56.  
  57. if ($mins != 0) {
  58. $str[$val['id']] = $val['price'] - $mins;
  59. }
  60. }
  61.  
  62. $maxid = array_search( next( $str ), $str );
  63. $class2 = new brand_car( );
  64. $str3 = $class2->getInfo( $maxid );
  65. $min = price_car_min( $maxid );
  66. $max = $str3['price'];
  67. $str = round( ( $max - $min ) / $max * 100, 2 );
  68. return $str;
  69. }
  70.  
  71. function price_car_min($id) {
  72. global $tblprefix;
  73. global $webdb;
  74.  
  75. $sql = . 'select min(oprice) as min from ' . $tblprefix . 'dealer_price where carid=\'' . $id . '\';';
  76. $price = $webdb->getValue( $sql );
  77. return $price['min'];
  78. }
  79.  
  80. function photo_enddete($id) {
  81. global $tblprefix;
  82. global $webdb;
  83.  
  84. $sql = . 'SELECT createdate FROM ' . $tblprefix . 'brand_photo where brandid=299 ORDER BY createdate DESC limit 0,1';
  85. $str = $webdb->getValue( $sql );
  86. return $str['createdate'];
  87. }
  88.  
  89. function oprice_car($id, $url = false) {
  90. global $tblprefix;
  91. global $webdb;
  92.  
  93. $sql = . 'select max(oprice) as maxp,min(oprice) as minp from ' . $tblprefix . 'dealer_price where carid=\'' . $id . '\';';
  94. $price = $webdb->getValue( $sql );
  95. $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾­ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
  96. $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
  97. return $oprice;
  98. }
  99.  
  100. function brand0_all2($id) {
  101. global $tblprefix;
  102. global $webdb;
  103.  
  104. $sql = . 'SELECT id FROM ' . $tblprefix . 'brand WHERE pid in(SELECT id FROM ' . $tblprefix . 'brand WHERE pid=' . $id . ') order by clicks DESC';
  105. $str = $webdb->getList( $sql );
  106.  
  107. foreach ($str as $val) {
  108. $key = ;
  109. $nstr[] = $val['id'];
  110. }
  111.  
  112. $str = implode( ',', $nstr );
  113. return $str;
  114. }
  115.  
  116. function brand1_all2($id) {
  117. global $tblprefix;
  118. global $webdb;
  119.  
  120. $sql = . 'SELECT id FROM ' . $tblprefix . 'brand WHERE pid=' . $id . ' and level=2 order by clicks DESC';
  121. $str = $webdb->getList( $sql );
  122.  
  123. foreach ($str as $val) {
  124. $key = ;
  125. $nstr[] = $val['id'];
  126. }
  127.  
  128. $str = implode( ',', $nstr );
  129. return $str;
  130. }
  131.  
  132. function oprice_brand($id, $url = false) {
  133. global $tblprefix;
  134. global $webdb;
  135.  
  136. $sql = . 'SELECT max(oprice) as maxp,min(oprice) as minp FROM ' . $tblprefix . 'dealer_price WHERE carid in(SELECT id FROM ' . $tblprefix . 'brand_car WHERE brandid=' . $id . ') and oprice!=0';
  137. $price = $webdb->getValue( $sql );
  138. $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾­ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
  139. $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
  140. return $oprice;
  141. }
  142.  
  143. function dealer_oprice_brand($bid, $did, $url = false) {
  144. global $tblprefix;
  145. global $webdb;
  146.  
  147. $sql = . 'SELECT max(oprice) as maxp,min(oprice) as minp FROM ' . $tblprefix . 'dealer_price WHERE brandid=' . $bid . ' and dealerid=' . $did;
  148. $price = $webdb->getValue( $sql );
  149. $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾­ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
  150. $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
  151. return $oprice;
  152. }
  153.  
  154. function price_brand($id, $url = false) {
  155. global $tblprefix;
  156. global $webdb;
  157.  
  158. $sql = . 'select max(price) as maxp,min(price) as minp from ' . $tblprefix . 'brand_car where brandid=\'' . $id . '\';';
  159. $price = $webdb->getValue( $sql );
  160. $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="³§ÉÌÖ¸µ¼¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
  161. $bprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞÖ¸µ¼¼Û' : $str);
  162. return $bprice;
  163. }
  164.  
  165. function pailiang_brand($id) {
  166. global $tblprefix;
  167. global $webdb;
  168.  
  169. $sql = . 'select distinct pailiang from ' . $tblprefix . 'brand_car where brandid=' . $id . ' order by pailiang asc;';
  170. $pailiang = $webdb->getList( $sql );
  171. return $pailiang;
  172. }
  173.  
  174. function biansuxiang_brand($id) {
  175. global $tblprefix;
  176. global $webdb;
  177.  
  178. $sql = ( . 'select distinct param9 from ' . $tblprefix . 'brand_car where brandid=' . $id . ';' );
  179. $biansuxiang = $webdb->getList( $sql );
  180. return $biansuxiang;
  181. }
  182.  
  183. function niankuan_brand($id) {
  184. global $tblprefix;
  185. global $webdb;
  186.  
  187. $sql = . 'select distinct niankuan from ' . $tblprefix . 'brand_car where brandid=' . $id . ' and niankuan!=0 order by niankuan desc;';
  188. $niankuan = $webdb->getList( $sql );
  189. return $niankuan;
  190. }
  191.  
  192. function ranking1($id) {
  193. global $tblprefix;
  194. global $webdb;
  195.  
  196. $sql = . 'select (select count(id) from ' . $tblprefix . 'brand where clicks>=a.clicks) as paiming from ' . $tblprefix . 'brand a where level=2 and a.id=' . $id;
  197. $ranking = $webdb->getValue( $sql );
  198. return $ranking['paiming'];
  199. }
  200.  
  201. function ranking2($id, $brand_level) {
  202. global $tblprefix;
  203. global $webdb;
  204.  
  205. $sql = ( . 'select (select count(id) from ' . $tblprefix . 'brand where clicks>=a.clicks) as paiming from ' . $tblprefix . 'brand a where level=2 and a.id=' . $id . ' and a.brand2_Level=\'' . $brand_level . '\'' );
  206. $ranking = $webdb->getValue( $sql );
  207. return $ranking['paiming'];
  208. }
  209.  
  210. function DealerSum($id, $area = false) {
  211. global $tblprefix;
  212. global $webdb;
  213.  
  214. $sql = . 'select distinct dealerid from ' . $tblprefix . 'dealer_price where brandid=' . $id;
  215. $DealerSum = $webdb->getList( $sql );
  216.  
  217. foreach ($DealerSum as $val) {
  218. $key = ;
  219. $xxxx-> .= $val['dealerid'];
  220. }
  221.  
  222. $xxx2 = implode( ',', $xxxx );
  223. $areas = ($area == false ? '' : 'areaid=' . $area . ' and ');
  224. $dealerid = ($xxx2 ? $xxx2 : 0);
  225. $sql2 = . 'select count(id) from ' . $tblprefix . 'dealer where ' . $areas . ' id in(' . $dealerid . ')';
  226. $DealerBrand = $webdb->getValue( $sql2 );
  227. return $DealerBrand[0];
  228. }
  229.  
  230. function DealerBrand($id, $area = false) {
  231. global $tblprefix;
  232. global $webdb;
  233.  
  234. $areas = ($area ? ' and areaid=' . $area : '');
  235. $sql = ( . 'select * from ' . $tblprefix . 'dealer where id in(select distinct dealerid from ' . $tblprefix . 'dealer_price where brandid=' . $id . ')' ) . $areas;
  236. $DealerBrand = $webdb->getList( $sql );
  237. return $DealerBrand;
  238. }
  239.  
  240. function Dealercar($id) {
  241. global $tblprefix;
  242. global $webdb;
  243.  
  244. $sql = . 'SELECT b.*,a.oprice FROM ' . $tblprefix . 'dealer_price a,' . $tblprefix . 'dealer b WHERE a.dealerid=b.id and a.carid=' . $id;
  245. $DealerBrand = $webdb->getList( $sql );
  246. return $DealerBrand;
  247. }
  248.  
  249. function UcarPercent($id) {
  250. global $tblprefix;
  251. global $webdb;
  252.  
  253. $arrays = $webdb->getList( . 'SELECT uprice,ucolor,ukms,upailiang,spsj,u_name,u_tel,u_mobile,u_qq,u_addres,u_sex,u_email,peizhi,info,img1,img2,img3,img4,img5,img6,radGearbox,radUse,radDrivePermit,radRegPermit,radInvoice,radFaxInvoice,selTaxDate,selAuditYear,selInsuranceYear,cheling FROM ' . $tblprefix . 'ucar WHERE id=' . $id );
  254.  
  255. foreach ($arrays[0] as $val) {
  256. $key = ;
  257.  
  258. if (!is_numeric( $key )) {
  259. if ($val) {
  260. $str[] = $val;
  261. }
  262. }
  263. }
  264.  
  265. return round( count( $str ) / 30 * 100, 0 );
  266. }
  267.  
  268. function comm_count($type, $where = 1, $select = '*') {
  269. global $tblprefix;
  270. global $webdb;
  271.  
  272. $new_type = $tblprefix . $type;
  273. $sql = . 'select count(' . $select . ') FROM ' . $new_type . ' where ' . $where;
  274. $rows_count = $webdb->getList( $sql );
  275. return $rows_count[0][0];
  276. }
  277.  
  278. function PageCount($from, $where = 1, $limit = 10, $type = 0) {
  279. global $tblprefix;
  280. global $webdb;
  281.  
  282. $newfrom = $tblprefix . $from;
  283. $sql_count = . 'SELECT count(*) FROM ' . $newfrom . ' WHERE ' . $where;
  284. $rows_count = $webdb->getList( $sql_count );
  285. $asdasdad = $rows_count[0][0];
  286.  
  287. if ($type == 1) {
  288. $count = $asdasdad;
  289. } else {
  290. $count = ceil( $asdasdad / $limit );
  291. }
  292.  
  293. return $count;
  294. }
  295.  
  296. function newskeywords($keywords) {
  297. $arr = explode( ' ', $keywords );
  298. return $arr;
  299. }
  300.  
  301. function content_reviews_update($type, $id) {
  302. global $webdb;
  303. global $tblprefix;
  304.  
  305. $commall = comm_count( 'content_reviews', 'checked=1 and type=\'' . $type . '\' and infoid=' . $id, '*' );
  306. $webdb->query( ( . 'update ' . $tblprefix . 'content_' . $type . ' set comment=\'' . $commall . '\' where id=' . $id . ';' ) );
  307. }
  308.  
  309. function html2text($str) {
  310. $str = preg_replace( '/<sty.*?\/style>|<scr.*?\/script>|<!--.*?-->/is', '', $str );
  311. $str = preg_replace( '/<\/?(?:p|div|dt|dd|li)\b.*?>/is', '<br>', $str );
  312. $str = preg_replace( '/\s+/', '', $str );
  313. $str = preg_replace( '/<br\s*\/?>/is', '
  314. ', $str );
  315. $str = strip_tags( $str );
  316. return str_replace( array( '&lt;', '&gt;', '&nbsp;', '&quot;', '&ldquo;', '&rdquo;', '&amp;', '&middot;' ), array( '<', '>', ' ', '"', '¡°', '¡±', '&', '¡¤' ), $str );
  317. }
  318.  
  319. function safe_string($str) {
  320. $str = str_replace( '\'', '', $str );
  321. $str = str_replace( '"', '', $str );
  322. $str = str_replace( ' ', ( . $nbsp . ';' ), $str );
  323. $str = str_replace( '
  324. ;', '<br/>', $str );
  325. $str = str_replace( '<', '<', $str );
  326. $str = str_replace( '>', '>', $str );
  327. $str = str_replace( ' ', ' ', $str );
  328. $str = str_replace( '
  329. ', '', $str );
  330. $str = str_replace( '/[\s ]+/', ' ', $str );
  331. return $str;
  332. }
  333. ....................................
  334. ...................
  335. .........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement