Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
- *
- * @ Version : 1.1.3.0
- * @ Author : DeZender
- * @ Release on : 17.05.2011
- * @ Official site : http://DeZender.Net
- *
- */
- function _version_key() {
- global $HtmlpathROOT;
- $str = file_get_contents( $HtmlpathROOT . '/caches/license.cert' );
- return $str;
- }
- function __autoload($class_name) {
- global $rootpath;
- $file = $rootpath . 'include/model/' . $class_name . '.class.php';
- if (!file_exists( $file )) {
- $file = $rootpath . 'include/class/' . $class_name . '.class.php';
- }
- include_once( $file );
- }
- function upfiles_is($type = 'www', $key, $name) {
- global $rootpath;
- global $rooturl;
- $show .= '<script language="javascript">';
- $show .= 'function upload_data_' . $name . '(){';
- $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");';
- $show .= '}';
- $show .= 'function upload_set_' . $name . '(id){';
- $show .= 'document.getElementById(\'' . $name . '\').value=id;';
- $show .= '}';
- $show .= '</script>';
- $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 . '()" />';
- return $show;
- }
- function price_rate($id) {
- $class = new brand_car( );
- $class->wheres = 'brandid=' . $id;
- $str2 = $class->getList( );
- foreach ($str2 as $val) {
- $mins = price_car_min( $val['id'] );
- if ($mins != 0) {
- $str[$val['id']] = $val['price'] - $mins;
- }
- }
- $maxid = array_search( next( $str ), $str );
- $class2 = new brand_car( );
- $str3 = $class2->getInfo( $maxid );
- $min = price_car_min( $maxid );
- $max = $str3['price'];
- $str = round( ( $max - $min ) / $max * 100, 2 );
- return $str;
- }
- function price_car_min($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select min(oprice) as min from ' . $tblprefix . 'dealer_price where carid=\'' . $id . '\';';
- $price = $webdb->getValue( $sql );
- return $price['min'];
- }
- function photo_enddete($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'SELECT createdate FROM ' . $tblprefix . 'brand_photo where brandid=299 ORDER BY createdate DESC limit 0,1';
- $str = $webdb->getValue( $sql );
- return $str['createdate'];
- }
- function oprice_car($id, $url = false) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select max(oprice) as maxp,min(oprice) as minp from ' . $tblprefix . 'dealer_price where carid=\'' . $id . '\';';
- $price = $webdb->getValue( $sql );
- $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
- $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
- return $oprice;
- }
- function brand0_all2($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'SELECT id FROM ' . $tblprefix . 'brand WHERE pid in(SELECT id FROM ' . $tblprefix . 'brand WHERE pid=' . $id . ') order by clicks DESC';
- $str = $webdb->getList( $sql );
- foreach ($str as $val) {
- $key = ;
- $nstr[] = $val['id'];
- }
- $str = implode( ',', $nstr );
- return $str;
- }
- function brand1_all2($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'SELECT id FROM ' . $tblprefix . 'brand WHERE pid=' . $id . ' and level=2 order by clicks DESC';
- $str = $webdb->getList( $sql );
- foreach ($str as $val) {
- $key = ;
- $nstr[] = $val['id'];
- }
- $str = implode( ',', $nstr );
- return $str;
- }
- function oprice_brand($id, $url = false) {
- global $tblprefix;
- global $webdb;
- $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';
- $price = $webdb->getValue( $sql );
- $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
- $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
- return $oprice;
- }
- function dealer_oprice_brand($bid, $did, $url = false) {
- global $tblprefix;
- global $webdb;
- $sql = . 'SELECT max(oprice) as maxp,min(oprice) as minp FROM ' . $tblprefix . 'dealer_price WHERE brandid=' . $bid . ' and dealerid=' . $did;
- $price = $webdb->getValue( $sql );
- $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="¾ÏúÉ̱¨¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
- $oprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞ±¨¼Û' : $str);
- return $oprice;
- }
- function price_brand($id, $url = false) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select max(price) as maxp,min(price) as minp from ' . $tblprefix . 'brand_car where brandid=\'' . $id . '\';';
- $price = $webdb->getValue( $sql );
- $str = ($url == false ? $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª' : '<a href="' . $url . '" target="_blank" title="³§ÉÌÖ¸µ¼¼Û£º' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª">' . $price['minp'] . '-' . $price['maxp'] . 'ÍòÔª</a>');
- $bprice = (( $price['maxp'] == 0 && $price['minp'] == 0 ) ? 'ÔÝÎÞÖ¸µ¼¼Û' : $str);
- return $bprice;
- }
- function pailiang_brand($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select distinct pailiang from ' . $tblprefix . 'brand_car where brandid=' . $id . ' order by pailiang asc;';
- $pailiang = $webdb->getList( $sql );
- return $pailiang;
- }
- function biansuxiang_brand($id) {
- global $tblprefix;
- global $webdb;
- $sql = ( . 'select distinct param9 from ' . $tblprefix . 'brand_car where brandid=' . $id . ';' );
- $biansuxiang = $webdb->getList( $sql );
- return $biansuxiang;
- }
- function niankuan_brand($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select distinct niankuan from ' . $tblprefix . 'brand_car where brandid=' . $id . ' and niankuan!=0 order by niankuan desc;';
- $niankuan = $webdb->getList( $sql );
- return $niankuan;
- }
- function ranking1($id) {
- global $tblprefix;
- global $webdb;
- $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;
- $ranking = $webdb->getValue( $sql );
- return $ranking['paiming'];
- }
- function ranking2($id, $brand_level) {
- global $tblprefix;
- global $webdb;
- $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 . '\'' );
- $ranking = $webdb->getValue( $sql );
- return $ranking['paiming'];
- }
- function DealerSum($id, $area = false) {
- global $tblprefix;
- global $webdb;
- $sql = . 'select distinct dealerid from ' . $tblprefix . 'dealer_price where brandid=' . $id;
- $DealerSum = $webdb->getList( $sql );
- foreach ($DealerSum as $val) {
- $key = ;
- $xxxx-> .= $val['dealerid'];
- }
- $xxx2 = implode( ',', $xxxx );
- $areas = ($area == false ? '' : 'areaid=' . $area . ' and ');
- $dealerid = ($xxx2 ? $xxx2 : 0);
- $sql2 = . 'select count(id) from ' . $tblprefix . 'dealer where ' . $areas . ' id in(' . $dealerid . ')';
- $DealerBrand = $webdb->getValue( $sql2 );
- return $DealerBrand[0];
- }
- function DealerBrand($id, $area = false) {
- global $tblprefix;
- global $webdb;
- $areas = ($area ? ' and areaid=' . $area : '');
- $sql = ( . 'select * from ' . $tblprefix . 'dealer where id in(select distinct dealerid from ' . $tblprefix . 'dealer_price where brandid=' . $id . ')' ) . $areas;
- $DealerBrand = $webdb->getList( $sql );
- return $DealerBrand;
- }
- function Dealercar($id) {
- global $tblprefix;
- global $webdb;
- $sql = . 'SELECT b.*,a.oprice FROM ' . $tblprefix . 'dealer_price a,' . $tblprefix . 'dealer b WHERE a.dealerid=b.id and a.carid=' . $id;
- $DealerBrand = $webdb->getList( $sql );
- return $DealerBrand;
- }
- function UcarPercent($id) {
- global $tblprefix;
- global $webdb;
- $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 );
- foreach ($arrays[0] as $val) {
- $key = ;
- if (!is_numeric( $key )) {
- if ($val) {
- $str[] = $val;
- }
- }
- }
- return round( count( $str ) / 30 * 100, 0 );
- }
- function comm_count($type, $where = 1, $select = '*') {
- global $tblprefix;
- global $webdb;
- $new_type = $tblprefix . $type;
- $sql = . 'select count(' . $select . ') FROM ' . $new_type . ' where ' . $where;
- $rows_count = $webdb->getList( $sql );
- return $rows_count[0][0];
- }
- function PageCount($from, $where = 1, $limit = 10, $type = 0) {
- global $tblprefix;
- global $webdb;
- $newfrom = $tblprefix . $from;
- $sql_count = . 'SELECT count(*) FROM ' . $newfrom . ' WHERE ' . $where;
- $rows_count = $webdb->getList( $sql_count );
- $asdasdad = $rows_count[0][0];
- if ($type == 1) {
- $count = $asdasdad;
- } else {
- $count = ceil( $asdasdad / $limit );
- }
- return $count;
- }
- function newskeywords($keywords) {
- $arr = explode( ' ', $keywords );
- return $arr;
- }
- function content_reviews_update($type, $id) {
- global $webdb;
- global $tblprefix;
- $commall = comm_count( 'content_reviews', 'checked=1 and type=\'' . $type . '\' and infoid=' . $id, '*' );
- $webdb->query( ( . 'update ' . $tblprefix . 'content_' . $type . ' set comment=\'' . $commall . '\' where id=' . $id . ';' ) );
- }
- function html2text($str) {
- $str = preg_replace( '/<sty.*?\/style>|<scr.*?\/script>|<!--.*?-->/is', '', $str );
- $str = preg_replace( '/<\/?(?:p|div|dt|dd|li)\b.*?>/is', '<br>', $str );
- $str = preg_replace( '/\s+/', '', $str );
- $str = preg_replace( '/<br\s*\/?>/is', '
- ', $str );
- $str = strip_tags( $str );
- return str_replace( array( '<', '>', ' ', '"', '“', '”', '&', '·' ), array( '<', '>', ' ', '"', '¡°', '¡±', '&', '¡¤' ), $str );
- }
- function safe_string($str) {
- $str = str_replace( '\'', '', $str );
- $str = str_replace( '"', '', $str );
- $str = str_replace( ' ', ( . $nbsp . ';' ), $str );
- $str = str_replace( '
- ;', '<br/>', $str );
- $str = str_replace( '<', '<', $str );
- $str = str_replace( '>', '>', $str );
- $str = str_replace( ' ', ' ', $str );
- $str = str_replace( '
- ', '', $str );
- $str = str_replace( '/[\s]+/', ' ', $str );
- return $str;
- }
- ....................................
- ...................
- .........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement