/
function.php
3007 lines (2863 loc) · 136 KB
/
function.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
header("Content-type:text/html;charset=utf-8;");
error_reporting(0);
select_yjl_db();
$charset_conn=0;
$surl_p='url/';
$dbprefix=$config['db_table_prefix'];
if (substr($_SERVER['HTTP_REFERER'], -11) == '/yjlnew.php') {
$_SERVER['HTTP_REFERER'] = $_GET['referer'];
}
function select_yjl_db() {
global $config;
$hostname_conn=$config['db_host'];
$database_conn=$config['db_name'];
$username_conn=$config['db_user'];
$password_conn=$config['db_pass'];
$conn=mysql_connect($hostname_conn, $username_conn, $password_conn) or die(mysql_error());
mysql_select_db($database_conn, $conn);
mysql_query("SET NAMES 'utf8'", $conn);
}
//db
require_once "lib/dbmysql.class.php";
require_once "lib/session.class.php";
//新版修改
function getDb() {
global $aNewDbConfig;
$oDb = DbMysql::getInstance($aNewDbConfig);
return $oDb;
}
/*
* 同步退出
*/
function syn_logout() {
global $udb;
$oDb = getDb();
$Session = new Session($oDb);
$Session->destroy($udb['uid']);
select_yjl_db();
}
/*
* 同步登录
*/
function syn_login($r_res) {
$oDb = getDb();
checkUser($r_res);
$Session = new Session($oDb);
$Session->setKey($r_res['uid']);
select_yjl_db();
}
/*
* 如果新版没有该用户则添加用户
*/
function checkUser($r_res) {
$oDb = getDb();
$cWhere = "id = '" . $r_res['uid'] . "' AND status = 0";
$cSql ="SELECT * FROM tb_user WHERE $cWhere";
$aUser = $oDb->fetchFirstArray($cSql);
if (empty($aUser)) {
$data = array(
'appid' => 1,//配置信息
'id' => $r_res['uid'],
'type' => ($r_res['qx'] >= 5) ? 2 : 1,//区分业主和监理师
'account' => $r_res['email'] ? $r_res['email'] : $r_res['nickname'],
//'password' => $r_res['password'],
'email' => $r_res['email'],
'reg_ip' => $r_res['regip'],
'last_login' => time(),
'createtime' => time(),
);
$oDb->insert('tb_user', $data);
} else {
$aSet = array(
'last_login' => time(),
);
if ($aUser['last_login'] < strtotime(date('Y-m-d'))) {
//每天登录积分加1
$aSet['integral'] = $aUser['integral'] + 1;
if ($aUser['usertype'] == 1 && $aSet['integral'] > 3) {
$aSet['isreal'] = 1;
//更新评分表
$oDb->update('tb_score', array('isreal' => 1), "uid = " . $r_res['uid']);
}
}
$oDb->update('tb_user', $aSet, $cWhere);
}
}
/*
* 反向同步【暂未使用】
*/
function checkSession() {
$oDb = getDb();
$key = $_COOKIE['SN_KEY'];
if (empty($key)) {
return false;
}
$data = $oDb->fetchFirstArray("SELECT * FROM tb_session WHERE `key` = '$key'");
//$data = $this->where(array('key'=>$key))->find();
if (empty($data)) {
return false;
}
//超过2小时过期
if (($data['expire'] + 7200) < time()) {
return false;
}
//ip变化
if (get_client_ip() != $data['ip']) {
return false;
}
//更新有效期
$oDb->update('tb_session', array('expire' => time() + 7200), "id = " . $data['id']);
//$this->where(array('id'=>$data['id']))->data(array('expire' => time() + 7200))->save();
return $data['uid'];
}
/**
* 获取客户端IP地址
* @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
* @return mixed
*/
function get_client_ip($type = 0) {
$type = $type ? 1 : 0;
static $ip = NULL;
if ($ip !== NULL) return $ip[$type];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$pos = array_search('unknown',$arr);
if(false !== $pos) unset($arr[$pos]);
$ip = trim($arr[0]);
}elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif (isset($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}
// IP地址合法验证
$long = sprintf("%u",ip2long($ip));
$ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
return $ip[$type];
}
function chksqlv(){
return version_compare(mysql_get_server_info(), '4.1.0', '>=');
}
if(chksqlv()){
mysql_query("SET NAMES 'utf8'", $conn);
$charset_conn=1;
}
$q_main=sprintf('select * from %s limit 1', $yjl_dbprefix.'main');
$main=mysql_query($q_main) or die(mysql_error());
$r_main=mysql_fetch_assoc($main);
mysql_free_result($main);
//$d_l1id=175;
//$d_l1title='杭州市';
$p_size=20;
$max_file=1024*2;
$u_ea=array('jpg', 'gif', 'png');
$u_jlea=array('jpg', 'doc', 'docx', 'pdf');
$a_filet=array('image/jpeg', 'application/msword', 'application/msword', 'application/pdf');
$a_wh_wbtp=array(80, 80);
$a_wh_jltt=array(63, 63);
$a_wh_jltpt=array(80, 80);
$a_wh_jltpw=600;
$a_wh_maxw=1000;
$a_wh_jlqt=array(128, 128);
$a_wh_utxb=array(128, 128);
$a_wh_utxs=array(50, 50);
$a_wh_utxm=array(65, 65);
$a_wh_xzhd=array(160, 160);
$a_wh_hdadw=250;
$a_wh_video=array(128, 96);
$pbl_w=200;
$pbl_s=9;
$pbl_p=2;
$fxt_w=230;
$yzm_sjjg=60;
$a_tsgz=array(
5=>array('监理师'),
array('设计师', '供应商', '施工企业')
);
$a_utv=array(2=>'监理', 1=>'业主', 0=>'友邻');
$a_gz=array(1=>'施工队长', '油漆工', '电工', '木工', '泥瓦工');
$a_cp=array(1=>'地板', '油漆', '饰品');
!$COOKIE['isgz']?$a_lc=array(1=>'隐蔽', '泥木', '油漆', '安装', '竣工', '软装'):$a_lc=array(4=>'安装','竣工');
$a_tlc=array(7=>'验房', '文件储存', '视频监理');
$a_clys=array(1=>'木制品', '油漆', '墙地砖', '电器', '其他');
$a_file=array(1=>'效果图', '预算书', '合同', '施工图纸');
$a_txlc=array('设计师', '项目经理', '材料商', '施工人员', '业主', '其他');
$a_dpfl=array(
array(1=>'专业', '服务'),
array(1=>'专业', '品质'),
array(1=>'服务', '价格')
);
$a_ys=array(1=>'5万元以下', '5万-10万元', '10万-20万元', '20万-25万元', '25万-50万元', '50万元以上');
$a_fg=array(1=>'现代简约', '欧式古典', '田园风格', '东南亚风格', '地中海', '美式乡村', '雅致风格', '日式风格', '中式风格', '新古典主义', '后现代风格', '其他');
$a_mj=array(1=>'90m²以下', '90-120m²', '120-150m²', '150-200m²', '200-500m²', '500m²以上');
$a_privacyo=array('所有人可见', '仅好友可见', '仅自己可见');
$maxpf=5;
$a_xqgc=array(1=>'新手上路', '装修设计', '装修过程', '软装', '晒账单');
$a_bank=array(1=>'中国农业银行', '中国工商银行', '中国建设银行', '招商银行');
$a_qzca=array(1=>'合同/预算', '施工问题');
$a_pay=array(
1=>array('alipay', '支付宝')
);
$sy_img0=array('sy1.png', 150, 51);
$sy_img1=array('sy2.png', 100, 42);
$a_userzd=array(
'nc'=>'',
'qx'=>0,
'gzfl'=>0,
'iswc'=>0,
'xqid'=>0,
'fxid'=>0,
'xq_0'=>'',
'xq_1'=>'',
'mobile'=>'',
'mcode'=>'',
'misyz'=>0,
't_mobile'=>'',
't_mcode'=>'',
'postcode'=>'',
'mj'=>0,
'ys'=>0,
'fg'=>0,
'ys_0'=>0,
'ys_1'=>0,
'ys_2'=>0,
'ys_3'=>0,
'ys_0_name'=>2,
'ys_0_xq'=>2,
'ys_0_mob'=>2,
'ys_0_qq'=>1,
'ys_0_msn'=>1,
'zsyz'=>0,
'isxg'=>0,
'iszxjl'=>0,
'isnc'=>0,
'tsgz'=>0,
'is_wb'=>0,
'email_ls'=>'',
'email_code'=>''
);
$a_fx=array(
array('新浪微博', 'http://v.t.sina.com.cn/share/share.php?url=[u]&title=[t]'),
array('腾讯微博', 'http://v.t.qq.com/share/share.php?url=[u]&title=[t]'),
array('QQ空间', 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=[u]&title=[t]'),
array('人人', 'http://widget.renren.com/dialog/share?resourceUrl=[u]&srcUrl=[u]&title=[t]'),
array('开心网', 'http://www.kaixin001.com/rest/records.php?url=[u]&style=11&content=[t]'),
array('百度搜藏', 'http://cang.baidu.com/do/add?iu=[u]&it=[t]'),
array('百度空间', 'http://apps.hi.baidu.com/share/?url=[u]&title=[t]'),
array('百度贴吧', 'http://tieba.baidu.com/i/app/open_share_api?link=[u]&title=[t]'),
array('MSN', 'http://profile.live.com/badge?url=[u]&title=[t]'),
array('豆瓣', 'http://shuo.douban.com/!service/share?href=[u]&name=[t]'),
array('网易微博', 'http://t.163.com/article/user/checkLogin.do?info=[t][u]'),
array('搜狐微博', 'http://t.sohu.com/third/post.jsp?url=[u]&title=[t0]')
);
$a_py=array(1=>'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#');
$jldimg_jg=3600*3;
$jldimg_zs=3600*6;
$q_res=sprintf('select jpid, url, t_url, o_url from %s where (isjl=0 or isjl=2) and is_del=1 and deltime<%s', $yjl_dbprefix.'jl_photo', (time()-$jldimg_zs));
$res=mysql_query($q_res) or die(mysql_error());
$r_res=mysql_fetch_assoc($res);
if(mysql_num_rows($res)>0){
$dSQL=sprintf('delete from %s where jpid=%s', $yjl_dbprefix.'jl_photo', $r_res['jpid']);
$result=mysql_query($dSQL) or die(mysql_error());
$dSQL=sprintf('delete from %s where jpid=%s', $yjl_dbprefix.'jl_topic', $r_res['jpid']);
$result=mysql_query($dSQL) or die(mysql_error());
unlink($r_res['url']);
unlink($r_res['t_url']);
unlink($r_res['o_url']);
}
mysql_free_result($res);
//$is_ie6=yjl_chkuag('MSIE 6')?1:0;
function yjl_SQLString($c, $t){
$c=(function_exists('get_magic_quotes_gpc') && !get_magic_quotes_gpc())?addslashes($c):$c;
switch($t){
case 'text':
$c=($c!='')?"'".str_replace("'", ''', $c)."'":'NULL';
break;
case 'search':
$c="'%%".$c."%%'";
break;
case 'int':
$c=($c!='')?intval($c):'0';
break;
}
return $c;
}
function yjl_writeText($f,$c){
if(is_writable($f) || !file_exists($f)){
if(!$h=fopen($f,'w'))return false;
if(!fwrite($h,$c))return false;
fclose($h);
}else{
return false;
}
return true;
}
function yjl_substrs($c, $zl=4){
$l=$zl*3;
if(strlen($c)>$l){
$l-=3;
$n=0;
for($i=0;$i<$l;$i++){
if(ord($c[$i])>127)$n++;
}
if($n%3>0)$l+=3-$n%3;
$c=substr($c,0,$l).'…';
}
return $c;
}
function yjl_getIP(){
global $_SERVER;
if(getenv('HTTP_CLIENT_IP')){
$ip=getenv('HTTP_CLIENT_IP');
}elseif(getenv('HTTP_X_FORWARDED_FOR')){
$ip=getenv('HTTP_X_FORWARDED_FOR');
}elseif(getenv('REMOTE_ADDR')){
$ip=getenv('REMOTE_ADDR');
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function yjl_imgpath($uid){
$k='www.jishigou.com';
$h=md5($k."\t".$uid."\t".strlen($uid)."\t".$uid%10);
$f0=$h{$uid%32}.'/';
$f1=$f0.abs(crc32($h)%100).'/';
return array($f0, $f1);
}
function yjl_urlkey($id){
$index='z6OmlGsC9xqLPpN7iw8UDAb4HIBXfgEjJnrKZSeuV2Rt3yFcMWhakQT1oY5v0d';
$base=62;
$out='';
$c=floor(log10($id)/log10($base));
for($t=$c;$t>=0;$t--){
$a=floor($id/pow($base, $t));
$out=$out.substr($index, $a, 1);
$id=$id-($a*pow($base, $t));
}
return $out;
}
function yjl_sendpost($u, $d){
$u=parse_url($u);
$s=@fsockopen($u['host'], 80, $en, $es, 30);
if(!$s){
return false;
}else{
fwrite($s, 'POST '.$u['path']." HTTP/1.0\r\n");
fwrite($s, 'Host: '.$u['host']."\r\n");
fwrite($s, "Content-type: application/x-www-form-urlencoded; charset=utf-8\r\n");
fwrite($s, 'Content-length: '.strlen($d)."\r\n");
fwrite($s, "Accept: */*\r\n");
fwrite($s, "\r\n");
fwrite($s, $d."\r\n");
fwrite($s, "\r\n");
$h='';
while($t=trim(fgets($s, 4096)))$h.=$t."\n";
$c='';
while(!feof($s))$c.=fgets($s, 4096);
fclose($s);
return $c;
}
}
function yjl_getfurl($u){
$u=trim($u);
if($u!='')return ((!strstr($u, '://') && !strstr($u, ':\\'))?'http://':'').$u;
}
function yjl_authcode($s, $o='DECODE', $k='', $e=0){
$c_l=4;
$k=md5($k);
$ka=md5(substr($k, 0, 16));
$kb=md5(substr($k, 16, 16));
$kc=$c_l?($o=='DECODE'?substr($s, 0, $c_l):substr(md5(microtime()), -$c_l)):'';
$c_k=$ka.md5($ka.$kc);
$k_l=strlen($c_k);
$s=$o=='DECODE'?base64_decode(substr($s, $c_l)):sprintf('%010d', $e?$e+time():0).substr(md5($s.$kb), 0, 16).$s;
$s_l=strlen($s);
$result='';
$box=range(0, 255);
$r_k=array();
for($i=0;$i<=255;$i++)$r_k[$i]=ord($c_k[$i%$k_l]);
for($j=$i=0;$i<256;$i++){
$j=($j+$box[$i]+$r_k[$i])%256;
$tmp=$box[$i];
$box[$i]=$box[$j];
$box[$j]=$tmp;
}
for($a=$j=$i=0;$i<$s_l;$i++){
$a=($a+1)%256;
$j=($j+$box[$a])%256;
$tmp=$box[$a];
$box[$a]=$box[$j];
$box[$j]=$tmp;
$result.=chr(ord($s[$i])^($box[($box[$a]+$box[$j])%256]));
}
if($o=='DECODE'){
if((substr($result, 0, 10)==0 || substr($result, 0, 10)-time()>0) && substr($result, 10, 16)==substr(md5(substr($result, 26).$kb), 0, 16)){
return substr($result, 26);
}else{
return '';
}
}else{
return $kc.str_replace('=', '', base64_encode($result));
}
}
function yjl_getzs($c){
$t=strlen($c);
$j=0;
$h=0;
for($i=0;$i<$t;$i++){
if(ord(substr($c,$i,1))>127){
if($h==0){
$h=1;
}else{
$h=0;
}
}else{
$h=0;
}
if($h==0)$j++;
}
return $j;
}
function yjl_chklog(){
global $_COOKIE, $config, $_SERVER, $dbprefix;
$admin_id=0;
if(isset($_COOKIE[$config['cookie_prefix'].'ajhAuth']) && $_COOKIE[$config['cookie_prefix'].'ajhAuth']!=''){
$k=md5($config['auth_key'].$_SERVER['HTTP_USER_AGENT'].'_IN_ADMIN_PANEL_'.date('Y-m-Y-m').'_');
$lk=yjl_authcode($_COOKIE[$config['cookie_prefix'].'ajhAuth'], 'DECODE', $k);
$ak=explode("\t", $lk);
if(isset($ak[0]) && trim($ak[0])!='' && isset($ak[1]) && intval($ak[1])>0){
$q_rep=sprintf('select uid from %s where uid=%s and password=%s and role_id=2 limit 1', $dbprefix.'members', yjl_SQLString($ak[1], 'int'), yjl_SQLString(trim($ak[0]), 'int'));
$rep=mysql_query($q_rep) or die(mysql_error());
if(mysql_num_rows($rep)>0)$admin_id=$ak[1];
mysql_free_result($rep);
}
}
return $admin_id;
}
function yjl_chkulog(){
global $_COOKIE, $config, $_SERVER, $dbprefix, $yjl_dbprefix, $a_userzd;
$udb=array('uid'=>0);
if(isset($_COOKIE[$config['cookie_prefix'].'auth']) && $_COOKIE[$config['cookie_prefix'].'auth']!=''){
$lk=yjl_authcode($_COOKIE[$config['cookie_prefix'].'auth'], 'DECODE', $config['auth_key']);
$ak=explode("\t", $lk);
if(isset($ak[0]) && trim($ak[0])!='' && isset($ak[1]) && intval($ak[1])>0){
//登录验证成功
}else {
return $udb;
}
} else {
return $udb;
}
//新版修改
//$uid = checkSession();
global $config;
$hostname_conn=$config['db_host'];
$database_conn=$config['db_name'];
$username_conn=$config['db_user'];
$password_conn=$config['db_pass'];
$dbprefix=$config['db_table_prefix'];
$conn=mysql_connect($hostname_conn, $username_conn, $password_conn) or die(mysql_error());
mysql_select_db($database_conn, $conn);
//if ($uid) {
//$q_res=sprintf('select * from %s where uid=%s limit 1', $dbprefix.'members', $uid);
$q_res=sprintf('select * from %s where uid=%s and password=%s limit 1', $dbprefix.'members', yjl_SQLString($ak[1], 'int'), yjl_SQLString(trim($ak[0]), 'text'));
$res=mysql_query($q_res) or die(mysql_error());
$r_res=mysql_fetch_assoc($res);
//print_r($q_res);die;
if(mysql_num_rows($res)>0){
$q_rep=sprintf('select * from %s where uid=%s limit 1', $yjl_dbprefix.'members', $r_res['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
$r_rep=mysql_fetch_assoc($rep);
if(mysql_num_rows($rep)>0){
foreach($a_userzd as $k=>$v)$r_res[$k]=$r_rep[$k];
}else{
$r_res['qx']=$r_res['role_id']==2?10:0;
$r_res['iswc']=$r_res['qx']==10?1:0;
foreach($a_userzd as $k=>$v){
if(!isset($r_res[$k]))$r_res[$k]=$v;
}
//新版修改 添加isnc,nc
//$iSQL=sprintf("insert into %s (uid, qx, isnc, nc) values (%s, %s, 1, '%s')", $yjl_dbprefix.'members',
//$r_res['uid'], $r_res['qx'], $r_res['nickname']);
$iSQL=sprintf("insert into %s (uid, qx) values (%s, %s)", $yjl_dbprefix.'members',
$r_res['uid'], $r_res['qx']);
//echo $iSQL;
$result=mysql_query($iSQL);
}
mysql_free_result($rep);
$udb=$r_res;
if($udb['qx']==5 || $udb['qx']==6){
$q_rep=sprintf('select uid from %s where uid=%s limit 1', $yjl_dbprefix.'ujl', $udb['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
if(mysql_num_rows($rep)==0){
$iSQL=sprintf('insert into %s (uid) values (%s)', $yjl_dbprefix.'ujl', $udb['uid']);
$repult=mysql_query($iSQL) or die(mysql_error());
}
mysql_free_result($rep);
}elseif($udb['qx']==0){
$q_rep=sprintf('select uid from %s where uid=%s limit 1', $yjl_dbprefix.'uyz', $udb['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
if(mysql_num_rows($rep)==0){
$iSQL=sprintf('insert into %s (uid) values (%s)', $yjl_dbprefix.'uyz', $udb['uid']);
$repult=mysql_query($iSQL) or die(mysql_error());
}
mysql_free_result($rep);
}
//同步登录新版
syn_login($r_res);
}
mysql_free_result($res);
//}
return $udb;
}
function yjl_udb($uid){
global $dbprefix, $yjl_dbprefix, $a_userzd;
$udb=array('uid'=>0);
$q_res=sprintf('select * from %s where uid=%s limit 1', $dbprefix.'members', $uid);
$res=mysql_query($q_res) or die(mysql_error());
$r_res=mysql_fetch_assoc($res);
if(mysql_num_rows($res)>0){
$q_rep=sprintf('select * from %s where uid=%s limit 1', $yjl_dbprefix.'members', $r_res['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
$r_rep=mysql_fetch_assoc($rep);
if(mysql_num_rows($rep)>0){
foreach($a_userzd as $k=>$v)$r_res[$k]=$r_rep[$k];
}else{
$r_res['qx']=$r_res['role_id']==2?10:0;
$r_res['iswc']=$r_res['qx']==10?1:0;
foreach($a_userzd as $k=>$v){
if(!isset($r_res[$k]))$r_res[$k]=$v;
}
$iSQL=sprintf('insert into %s (uid, qx) values (%s, %s)', $yjl_dbprefix.'members',
$r_res['uid'],
$r_res['qx']);
$result=mysql_query($iSQL);
}
mysql_free_result($rep);
$udb=$r_res;
if($udb['qx']==5 || $udb['qx']==6){
$q_rep=sprintf('select uid from %s where uid=%s limit 1', $yjl_dbprefix.'ujl', $udb['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
if(mysql_num_rows($rep)==0){
$iSQL=sprintf('insert into %s (uid) values (%s)', $yjl_dbprefix.'ujl', $udb['uid']);
$repult=mysql_query($iSQL) or die(mysql_error());
}
mysql_free_result($rep);
}elseif($udb['qx']==0){
$q_rep=sprintf('select uid from %s where uid=%s limit 1', $yjl_dbprefix.'uyz', $udb['uid']);
$rep=mysql_query($q_rep) or die(mysql_error());
if(mysql_num_rows($rep)==0){
$iSQL=sprintf('insert into %s (uid) values (%s)', $yjl_dbprefix.'uyz', $udb['uid']);
$repult=mysql_query($iSQL) or die(mysql_error());
}
mysql_free_result($rep);
}
}
mysql_free_result($res);
return $udb;
}
function yjl_adminhtml($c){
global $yjl_tpath, $js_c;
return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link href="'.$yjl_tpath.'templates/default/styles/admincp.css" rel="stylesheet" type="text/css" /><link href="admin.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="lib/jquery.js"></script><script type="text/javascript" src="lib/function.js"></script>'.($js_c!=''?'<script type="text/javascript">
$(document).ready(function(){
'.$js_c.'
});
</script>':'').'</head><body><table width="100%" border="0" cellpadding="2" cellspacing="6" style="_margin-left:-10px; "><tr><td><table width="100%" border="0" cellpadding="2" cellspacing="6"><tr><td>'.$c.'</td></tr></table></td></tr></table></body></html>';
}
function yjl_getMsg($c){
return '<table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder" id="msg_table"><tr><td style="padding-left:20px;">'.$c.' <a href="#" onclick="$(\'#msg_table\').hide();return false;">x</a></td></tr></table>';
}
function yjl_userl($uid, $mid=''){
global $udb, $yjl_dbprefix;
$s='<h2>个人中心</h2><ul class="list_centnav hover">
<li'.($mid=='index'?' class="current"':'').'><a href="user-'.$uid.'.html">我的首页</a></li>
<li'.($mid=='hd'?' class="current"':'').'>'.(($udb['uid']==$uid && ($udb['xqid']>0 || $udb['isxg']>0 || $udb['qx']>0))?'<span><a href="active_create.php?xqid='.$udb['xqid'].'">+发起</a></span>':'').'<a href="user_active.php?id='.$uid.'">我的活动</a></li>
<li'.($mid=='jl'?' class="current"':'').'>';
$iscj=0;
if($udb['uid']==$uid){
if($udb['qx']==5){
$iscj=1;
}elseif($udb['qx']==0){
$q_res=sprintf('select hzid from %s where hzid=%s and isjs=0 limit 1', $yjl_dbprefix.'jl', $udb['uid']);
$res=mysql_query($q_res) or die(mysql_error());
if(mysql_num_rows($res)==0)$iscj=1;
mysql_free_result($res);
}
}
if($iscj>0)$s.='<span><a href="photo_create.php?xqid='.$udb['xqid'].'">+创建</a></span>';
$s.='<a href="user_decoration.php?id='.$uid.'">我的项目</a></li>
</ul>
<hr class="dotted" />
<ul class="list_centnav hover">
<li'.($mid=='hy'?' class="current"':'').'><a href="follow.php?id='.$uid.'">好友</a></li>'.($udb['uid']==$uid?'
<li'.($mid=='yx'?' class="current"':'').'><a href="msg.php">信箱</a></li>
<li'.($mid=='dt'?' class="current"':'').'><a href="user_log.php">动态</a></li>
<li'.($mid=='sc'?' class="current"':'').'><a href="myfav.php">收藏夹</a></li>
<li'.($mid=='zx'?' class="current"':'').'><a href="address_book.php">装修通讯录</a></li>':'').'
</ul>';
return $s;
}
function yjl_gehtml($l, $c, $t){
global $js_c, $isupimg, $yjl_tpath, $xqid, $xqdb, $page_title, $r_main, $a_fx, $udb, $uadb, $cuid;
$s='<div class="location"><a href="user-'.$cuid.'.html">'.($cuid!=$udb['uid']?$uadb[$cuid]['nc'].'的':'').'个人中心</a>><a href="#">'.$t.'</a></div><div class="left">'.$l.'</div><div class="right">'.$c.'</div>';
return yjl_html($s, 'per_center', 'center');
}
function yjl_html_head($c, $css='', $body_id='', $menu_id=0){
global $js_c, $js_scrc, $isupimg, $yjl_tpath, $xqid, $xqdb, $page_title, $r_main, $a_fx, $udb, $is_home, $is_nologin, $is_mce, $yjl_isdebug, $d_l1title, $d_l1id;
$ptitle=($page_title!=''?$page_title.' | ':'').$r_main['site_name'];
if($udb['uid']>0 && $udb['iswc']==1 && (($udb['qx']==5 && $udb['iszxjl']==1) || $udb['qx']==10 || $udb['isxg']>0)){
$js_c.='
jlmsg_v();';
$js_scrc.='
jlmsg_p();';
}
if($js_scrc!='')$js_c.='
$(window).scroll(function(){
'.$js_scrc.'
});';
$s='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
preg_match("/<head>([\w\W]+)<\/head>/", $c, $matches);
if ($matches[1]) {
$s .= $matches[1];
} else {
$s .= '
<title>易监理 - 装修行业中代表良心的力量,家装监理,连锁店装修监理,别墅装修监理,别墅监理,上海家装监理公司,家装监理公司</title>
<meta name="keywords" content="易监理是商业装修和别墅装修监理领域的领导者,装修行业中代表良心的力量,为中国领先的装修监理服务网站,提供业界最先进的线上线下专业监理服务。"/>
<meta name="description" content="易监理,上海家装监理公司,家装监理公司,上海装修监理公司,家装监理,装潢监理,上海家装监理,上海装潢监理,上海装饰监理,上海装修监理,上海家庭装潢监理,装修监理,上海装修监理,验房,上海验房,家装监理师,装饰监理师,别墅监理,别墅装饰监理,家装工程监理,家庭装修监理,水电监理,家装监理费,家装施工监理,装修第三方监理"/>';
}
$s .= '
<link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="images/iphone_logo.png" />
<link rel="apple-touch-icon" sizes="72x72" href="images/ipad_logo.png" />
<link rel="apple-touch-icon" sizes="114x114" href="images/iphone_retina_logo.png" />
<link rel="apple-touch-icon" sizes="144x144" href="images/ipad_retina_logo.png" />
<meta property="wb:webmaster" content="4e74fb62f6f0d410" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/old.css" rel="stylesheet" type="text/css" />'.($css!=''?'
<link href="css/'.$css.'.css" rel="stylesheet" type="text/css" />':'').'
<script type="text/javascript" src="scripts/jquery.dookay.min.js"></script>
<script type="text/javascript" src="scripts/jquery.dookay.plugin.js"></script>
<script type="text/javascript" src="lib/jquery.rotate.js"></script>
<script type="text/javascript" src="lib/function.js"></script>
'.($is_mce>0?'<script type="text/javascript" src="lib/tiny_mce/jquery.tinymce.js"></script>':'').($isupimg>0?'<script type="text/javascript" src="'.$yjl_tpath.'templates/default/js/swfobject.js"></script><script type="text/javascript" src="'.$yjl_tpath.'images/uploadify/jquery.uploadify.v2.1.4.min.js"></script><style type="text/css">@import "'.$yjl_tpath.'images/uploadify/uploadify.css";</style>':'').($js_c!=''?'<script type="text/javascript">
$(document).ready(function(){
'.$js_c.'
});
</script>':'').'<!--[if IE 6]>
<script type="text/javascript" src="scripts/dookay.png.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix(\' #phead,.hd_ico,.mn_ico,.show \');
</script>
<![endif]-->
</head>
<body>
';
if($udb['uid']>0 && $udb['iswc']==1 && (($udb['qx']==5 && $udb['iszxjl']==1) || $udb['qx']==10 || $udb['isxg']>0))$s.='<div id="jlmsg_v" style="display: none;"><a href="#" onclick="$(\'#jlmsg_v\').hide();$(\'#jlmsg_isl\').val(\'1\');return false;"><img src="images/list_style02.gif" style="float: right;"></a><span id="msg_cs">0</span>条新咨询'.(($udb['qx']==5 && $udb['iszxjl']==1)?',<a href="faq-no.html">查看并回答</a>':'').'<input type="hidden" id="jlmsg_isl" value="0"/><input type="hidden" id="jlmsg_v" value="0"/></div>';
$s.='<div id="wrap">
<link rel="stylesheet" href="house/statics/index/css/style.css">
<div class="wrap">
<div class="pbar">
<div class="top clearfix">
<div class="left city_list">
'.$d_l1title.' <a href="javascript:void(0)" onclick="$(\'#city_list_box\').show();" class="open_clos" style="color:#fff;">[请选择地区]</a><a href="gz.php" style="margin-left:20px; font-weight:bold; color:#a2a2a2;">进入工装</a>
<div id="city_list_box" class="city_list_box">
<div style="position:relative"><em class="cityem_t"></em><em onclick="$(\'#city_list_box\').hide();" class="off_cityList"></em></div>
<div>进入:<span style="font-size:20px; font-weight:bold"><a href="http://www.yijianli.com/index.php">上海</a></span></div>
<h2 class="citytitle">选择您的对应地区</h2>
<div class="city_content">
<a href="http://www.yijianli.com/index.php" class="am_addstyle">上海</a><a href="http://sz.yijianli.com/index.php">苏州</a><a href="http://nj.yijianli.com/index.php">南京</a><a href="http://wx.yijianli.com/index.php">无锡</a><a href="http://hz.yijianli.com/index.php">杭州</a><a href="http://nb.yijianli.com/index.php">宁波</a><a href="http://sx.yijianli.com/index.php">绍兴</a>
</div>
</div>
</div>
<div class="left">
</div>';
/*<div class="pop_t" style="overflow:auto;zoom:1"><div class="halfPop"></div>
<div class="pop_chuang">
<img src="images/close.png" width="36" height="36" class="off" />
<div class="re">
<div class="top">
<img src="images/clock.gif"><h1>填写预约信息</h1>
</div>
<form action="/jianli/house/index.php?s=/Reserve/add/type/3/id/'.$_GET['id'].'" method="post">
<table class="cen">
<tr><td class="left">姓名:</td><td class="right"><input type="text" name="name"></td></tr>
<tr><td class="left">手机号:</td><td class="right"><input type="text" name="telephone"></td></tr>
<tr><td class="left">小区:</td><td class="right"><input type="text" name="region"></td></tr>
<tr><td class="left">邮箱:</td><td class="right"><input type="text" name="email"></td></tr>
</table>
<div class="foot">
<input type="image" src="images/add_reserve.gif" ></input>
</div>
</form>
</div>
*/
if($udb['uid']>0){
$iswc=(($udb['iswc']!=1 && ($udb['qx']==5 || $udb['qx']==6)) || $udb['isnc']==0)?0:1;
$s.='<div class="right login">'
.($iswc>0 ? '<a href="msg.php"><span class="hd_ico ico05" style="vertical-align: bottom;"> </span>'.($udb['newpm']>0?'<small style="color: #f00;">'.($udb['newpm']>9?'9+':$udb['newpm']).'</small>':'').'</a>':'').'
<a href="user-'.$udb['uid'].'.html">'.($udb['nc']!=''?$udb['nc']:$udb['email']).'</a>
<a href="profile.php">设置</a>
<a href="user_decoration.php?id='.$udb['uid'].'">个人中心</a>
'.(($udb['qx']==10 || $udb['isxg']>0)?'<a href="admin.php">后台管理</a>':'').'
<a href="logout.php?referer='.$_SERVER['HTTP_REFERER'].'">退出登录</a>
</div>';
}else{
$s .= '<div class="right login">已有账号? <a href="login.php?referer='.$_SERVER['HTTP_REFERER'].'" id="link_login" rel="#overlay_login">登陆</a> <span class="orange"><a href="reg.php?referer='.$_SERVER['HTTP_REFERER'].'">免费注册</a></span> <a href="login.php?t=sina" title="新浪微博登录"><img src="images/sbutton1.png" width="15px" height="15px"></a> <a href="login.php?t=tqq" title="QQ登录"><span class="mn_ico ico12"></span></a></div>';
}
//<a href="house" data-match="/house"><span class="oco05"></span>谁施工好</a>
//<a href="new" data-match="/new"><span class="oco02"></span>选监理</a>
//<a href="photo-0.html" data-config="default"><span class="oco03"></span>监理项目</a>
//<a href="index.php" data-match="index.php$"><span class="oco01"></span>首页</a>
$s .='</div>
</div><!-- pbar结束 -->';
if (!$GLOBALS['NEW_ALL'] && $d_l1id != 166) {
$s .= '<div class="phead">
<div class="head clearfix">
<div class="logo left">装修从此容易!</div>
<div class="menu left" id="main_menu">
<a href="index.php"><span class="ico01"></span>监理服务</a>
<a href="javascipt:void(0)"><span class="oco02"></span>我要监理</a>
<a href="javascipt:void(0)"><span class="oco03"></span>验房360</a>
<a href="javascipt:void(0)"><span class="oco04"></span>样板参观</a>
<a href="javascipt:void(0)"><span class="oco05"></span>关于易监理</a>
<div class="cascade show">
<ul>
<li><a href="#">选监理师</a>
<div class="cascade_3">
<p><a href="new/index.php?a=index&m=supervisor&f=2">别墅监理师</a></p>
<p><a href="new/index.php?a=index&m=supervisor&f=3">公寓监理师</a></p>
<p><a href="new/index.php?a=index&m=supervisor&f=6">维权律师</a></p>
</div>
</li>
<li><a href="photo-0.html" class="nobackground">照片式监理</a></li>
<li><a href="new/index.php?a=company&m=company&cid=6">预算</a>
<div class="cascade_3">
<p><a href="#">在线预算服务</a></p>
<p><a href="#">线下预算服务</a></p>
<p><a href="new/index.php?a=index&m=supervisor&f=4">预算师</a></p>
</div>
</li>
<li><a href="#">家装监理</a>
<div class="cascade_3">
<p><a href="new/index.php?a=company&m=company&cid=7">别墅监理</a></p>
<p><a href="new/index.php?a=company&m=company&cid=7">公寓监理</a></p>
</div>
</li>
</ul>
</div>
<div class="cascade_ck show">
<ul>
<li><a href="new/index.php?a=index&m=reserve&cid=7" class="nobackground">在线预约监理</a></li>
<li><a href="faq-new.html" class="nobackground">在线监理咨询</a></li>
<li><a href="about-paypal.html" class="nobackground">在线支付</a></li>
</ul>
</div>
<div class="home360 show">
<ul>
<li><a href="new/index.php?a=company&m=company&cid=8" class="nobackground">精装修验房</a></li>
<li><a href="new/index.php?a=company&m=company&cid=9" class="nobackground">毛坯房验房</a></li>
<li><a href="new/index.php?a=index&m=supervisor&f=5" class="nobackground">验房师</a></li>
</ul>
</div>
<div class="visitModel show">
<ul>
<li><a href="#" class="nobackground">样板房参观会</a></li>
<li><a href="#" class="nobackground">样板工地</a></li>
<li><a href="#" class="nobackground">施工质量认证</a></li>
</ul>
</div>
<div class="aboutYijianli show">
<ul>
<li><a href="new/index.php?s=/supervisor/consult/type/2" class="nobackground">选择易监理的理由</a></li>
<li><a href="new/index.php?s=/supervisor/consult/type/17" class="nobackground">监理资质</a></li>
<li><a href="new/index.php?s=/supervisor/consult/type/18" class="nobackground">服务保障</a></li>
<li><a href="new/index.php?s=/supervisor/consult/type/14" class="nobackground">联系我们</a></li>
</ul>
</div>
</div>
<div class="right" style="margin-top:15px"><img src="house/statics/index/images/Construction/Phone.png"></div>
</div>
</div>
</div><!-- phead 结束-->';
} else {
$s .= file_get_contents('newnav/html/head.html');
}
$s .='<div class="clear"></div>
</div>
</div>';
//<a href="house/?s=/Active" data-match="/Active"><span class="oco04"></span>样板参观</a>
$s.='<div class="overlay" id="overlay_login">
<h3>用户登录</h3>
<div class="overlay_cont">
<form method="post" class="main_form" action="login.php">
<table>
<tr>
<th width="80">邮箱</th>
<td><input type="text" class="text" name="username" /></td>
</tr>
<tr>
<th>密码</th>
<td><input type="password" class="text" name="password" /></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" class="checkbox" name="rem" value="1" checked="checked" /><span class="form_tip">记住密码 <a href="getpwd.php">忘记密码?</a></span></td>
</tr>
<tr>
<th></th>
<td><input type="submit" value="登 录" class="submit sub_reg" /><input type="hidden" name="u" value="'.urlencode('http://'.$_SERVER['HTTP_HOST'].$ru).'"/> 还没有账号?<a href="reg.php">立即注册</a></td>
</tr>
</table>
</form>
</div></div>';
return $s;
}
function yjl_html_gz_head($c, $css='', $body_id='', $menu_id=0){
global $js_c, $js_scrc, $isupimg, $yjl_tpath, $xqid, $xqdb, $page_title, $r_main, $a_fx, $udb, $is_home, $is_nologin, $is_mce, $yjl_isdebug, $d_l1title, $d_l1id;
$ptitle=($page_title!=''?$page_title.' | ':'').$r_main['site_name'];
if($udb['uid']>0 && $udb['iswc']==1 && (($udb['qx']==5 && $udb['iszxjl']==1) || $udb['qx']==10 || $udb['isxg']>0)){
$js_c.='
jlmsg_v();';
$js_scrc.='
jlmsg_p();';
}
if($js_scrc!='')$js_c.='
$(window).scroll(function(){
'.$js_scrc.'
});';
$s='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
';
preg_match("/<head>([\w\W]+)<\/head>/", $c, $matches);
if ($matches[1]) {
$s .= $matches[1];
} else {
$s .= '<title>易监理 - 装修行业中代表良心的力量,家装监理,连锁店装修监理,别墅装修监理,别墅监理,上海家装监理公司,家装监理公司</title>
<meta name="keywords" content="易监理是商业装修和别墅装修监理领域的领导者,装修行业中代表良心的力量,为中国领先的装修监理服务网站,提供业界最先进的线上线下专业监理服务。"/>
<meta name="description" content="易监理,上海家装监理公司,家装监理公司,上海装修监理公司,家装监理,装潢监理,上海家装监理,上海装潢监理,上海装饰监理,上海装修监理,上海家庭装潢监理,装修监理,上海装修监理,验房,上海验房,家装监理师,装饰监理师,别墅监理,别墅装饰监理,家装工程监理,家庭装修监理,水电监理,家装监理费,家装施工监理,装修第三方监理"/>
';
}
$s .= '<link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="images/iphone_logo.png" />
<link rel="apple-touch-icon" sizes="72x72" href="images/ipad_logo.png" />
<link rel="apple-touch-icon" sizes="114x114" href="images/iphone_retina_logo.png" />
<link rel="apple-touch-icon" sizes="144x144" href="images/ipad_retina_logo.png" />
<meta property="wb:webmaster" content="4e74fb62f6f0d410" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/old.css" rel="stylesheet" type="text/css" />'.($css!=''?'
<link href="css/'.$css.'.css" rel="stylesheet" type="text/css" />':'').'
<script type="text/javascript" src="scripts/jquery.dookay.min.js"></script>
<script type="text/javascript" src="scripts/jquery.dookay.plugin.js"></script>
<script type="text/javascript" src="lib/jquery.rotate.js"></script>
<script type="text/javascript" src="lib/function.js"></script>
'.($is_mce>0?'<script type="text/javascript" src="lib/tiny_mce/jquery.tinymce.js"></script>':'').($isupimg>0?'<script type="text/javascript" src="'.$yjl_tpath.'templates/default/js/swfobject.js"></script><script type="text/javascript" src="'.$yjl_tpath.'images/uploadify/jquery.uploadify.v2.1.4.min.js"></script><style type="text/css">@import "'.$yjl_tpath.'images/uploadify/uploadify.css";</style>':'').($js_c!=''?'<script type="text/javascript">
$(document).ready(function(){
'.$js_c.'
});
</script>':'').'<!--[if IE 6]>
<script type="text/javascript" src="scripts/dookay.png.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix(\' #phead,.hd_ico,.mn_ico,.show \');
</script>
<![endif]-->
</head>
<body>
';
if($udb['uid']>0 && $udb['iswc']==1 && (($udb['qx']==5 && $udb['iszxjl']==1) || $udb['qx']==10 || $udb['isxg']>0))$s.='<div id="jlmsg_v" style="display: none;"><a href="#" onclick="$(\'#jlmsg_v\').hide();$(\'#jlmsg_isl\').val(\'1\');return false;"><img src="images/list_style02.gif" style="float: right;"></a><span id="msg_cs">0</span>条新咨询'.(($udb['qx']==5 && $udb['iszxjl']==1)?',<a href="faq-no.html">查看并回答</a>':'').'<input type="hidden" id="jlmsg_isl" value="0"/><input type="hidden" id="jlmsg_v" value="0"/></div>';
$s.='<div id="wrap">
<link rel="stylesheet" href="house/statics/index/css/style.css">
<div class="wrap">
<div class="pbar">
<div class="top clearfix">
<div class="left city_list">
'.$d_l1title.' <a href="javascript:void(0)" onclick="$(\'#city_list_box\').show();" class="open_clos">[请选择地区]</a>
<div id="city_list_box" class="city_list_box">
<div style="position:relative"><em class="cityem_t"></em><em onclick="$(\'#city_list_box\').hide();" class="off_cityList"></em></div>
<div>进入:<span style="font-size:20px; font-weight:bold"><a href="http://www.yijianli.com/gz.php">上海</a></span></div>
<h2 class="citytitle">选择您的对应地区</h2>
<div class="city_content">
<a href="http://www.yijianli.com/gz.php" class="am_addstyle">上海</a><a href="http://sz.yijianli.com/gz.php">苏州</a><a href="http://nj.yijianli.com/gz.php">南京</a><a href="http://wx.yijianli.com/gz.php">无锡</a><a href="http://hz.yijianli.com/gz.php">杭州</a><a href="http://nb.yijianli.com/gz.php">宁波</a><a href="http://sx.yijianli.com/gz.php">绍兴</a>
</div>
</div>
</div>
';
if($udb['uid']>0){
$iswc=(($udb['iswc']!=1 && ($udb['qx']==5 || $udb['qx']==6)) || $udb['isnc']==0)?0:1;
$s.='<div class="right login">'
.($iswc>0 ? '<a href="msg.php"><span class="hd_ico ico05" style="vertical-align: bottom;"> </span>'.($udb['newpm']>0?'<small style="color: #f00;">'.($udb['newpm']>9?'9+':$udb['newpm']).'</small>':'').'</a>':'').'
<a href="user-'.$udb['uid'].'.html">'.($udb['nc']!=''?$udb['nc']:$udb['email']).'</a>
<a href="profile.php">设置</a>
<a href="user_decoration.php?id='.$udb['uid'].'">个人中心</a>
'.(($udb['qx']==10 || $udb['isxg']>0)?'<a href="admin.php">后台管理</a>':'').'
<a href="logout.php?referer='.$_SERVER['HTTP_REFERER'].'">退出登录</a>
</div>';
}else{
$s .= '<div class="right login">已有账号? <a href="login.php?referer='.$_SERVER['HTTP_REFERER'].'" id="link_login" rel="#overlay_login">登陆</a> <span class="orange"><a href="reg.php?referer='.$_SERVER['HTTP_REFERER'].'">免费注册</a></span> <a href="login.php?t=sina" title="新浪微博登录"><img src="images/sbutton1.png" width="15px" height="15px"></a> <a href="login.php?t=tqq" title="QQ登录"><span class="mn_ico ico12"></span></a></div>';
}
$s.='<div class="overlay" id="overlay_login">
<h3>用户登录</h3>
<div class="overlay_cont">
<form method="post" class="main_form" action="login.php">
<table>
<tr>
<th width="80">邮箱</th>
<td><input type="text" class="text" name="username" /></td>
</tr>
<tr>
<th>密码</th>
<td><input type="password" class="text" name="password" /></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" class="checkbox" name="rem" value="1" checked="checked" /><span class="form_tip">记住密码 <a href="getpwd.php">忘记密码?</a></span></td>
</tr>
<tr>
<th></th>
<td><input type="submit" value="登 录" class="submit sub_reg" /><input type="hidden" name="u" value="'.urlencode('http://'.$_SERVER['HTTP_HOST'].$ru).'"/> 还没有账号?<a href="reg.php">立即注册</a></td>
</tr>
</table>
</form>
</div></div>';
$s .='</div>
</div><!-- pbar结束 -->';
if ($GLOBALS['NEW_ALL'] || $d_l1id == 166) {
$s .= file_get_contents('newnav/html/gz_head.html');
} else {